|
1 | 1 | # Breaking Changes
|
2 | 2 |
|
| 3 | +## v6 |
| 4 | + |
| 5 | +When udpating from version 5 to version 6, there are breaking changes to the Go API: |
| 6 | + |
| 7 | +- Set's LoadTemplate() method was removed |
| 8 | + |
| 9 | + LoadTemplate() (which used to parse and cache a template while bypassing the Set's Loader) is removed in favor of the [new in-memory Loader](https://godoc.org/github.com/CloudyKit/jet#InMemLoader) where you can add templates on-the-fly (which is also used for tests without template files). Using it together with a file Loader via a MultiLoader restores the previous functionality: having template files accessed via the Loader and purely in-memory templates on top of those. [#182](https://github.com/CloudyKit/jet/pull/182) |
| 10 | + |
| 11 | +- Loader interface changed |
| 12 | + |
| 13 | + A Loader's Exists() method does not return the path to the template if it was found. Jet doesn't really care about what path the Loader implementation uses to locate the template. Jet expects the Loader to guarantee that the path it tried in Exists() to also work in calls to Open(), when the Exists() call returned true. [#183](https://github.com/CloudyKit/jet/pull/183) |
| 14 | + |
| 15 | +- a new Cache interface was introduced |
| 16 | + |
| 17 | + Previously, it was impossible to control if and how long a Set caches templates it parsed after fetching them via the Loader. Now, you can pass a custom Cache implementation to have complete control over caching behavior, for example to invalidate a cached template and making a Set re-fetch it via the Loader and re-parse it. [#183](https://github.com/CloudyKit/jet/pull/183) |
| 18 | + |
| 19 | +- new NewSet() with option functions |
| 20 | + |
| 21 | + The different functions used to create a Set (NewSet, NewSetLoader, NewHTMLSet, NewHTMLSetLoader()) have been removed in favor of a single NewSet() function that requires only a loader and accepts any number of configuration options in the form of option functions. When not passing any options, NewSet() will now use the HTML safe writer by default. |
| 22 | + |
| 23 | +- SetDevelopmentMode(), Delims(), SetExtensions() converted to option functions |
| 24 | + |
| 25 | + The new InDevelopmentMode(), WithDelims() and WithTemplateNameExtensions() option functions replace the previous functions. This means you can't change these settings after the Set is created, which was very likely not a good idea anyway. |
| 26 | + |
| 27 | + If you toggle development mode after Set creation, you can now use a custom Cache to configure cache-use on the fly. Since this is all the development mode does anyway, the InDevelopmentMode() option might be removed in a future major version of Jet. |
| 28 | + |
| 29 | +There are no breaking changes to the template language. |
| 30 | + |
3 | 31 | ## v5
|
4 | 32 |
|
5 |
| -When updating from version 4 to version 5, there is a breaking changes: |
| 33 | +When updating from version 4 to version 5, there is a breaking change: |
6 | 34 |
|
7 | 35 | - `_` became a reserved symbol
|
8 | 36 |
|
|
0 commit comments