@fractality/nunjucks 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -18
- package/README.md +3 -3
- package/package.json +19 -5
- package/src/extensions/render.js +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.3.0](https://github.com/sitepark/fractality/compare/%40fractality%2Fnunjucks%402.2.3...%40fractality%2Fnunjucks%402.3.0) (2026-08-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **deps:** update dependencies ([3c598f9](https://github.com/sitepark/fractality/commit/3c598f95a148a151c97f0d3c3293ba924862155c))
|
|
11
|
+
- **nunjucks:** don't hang forever when context resolution fails ([e317763](https://github.com/sitepark/fractality/commit/e3177638f3f34c4f8ab9d97663f0d091c369f95e))
|
|
12
|
+
- use workspace protocol for inter-package dependencies ([79b0fd6](https://github.com/sitepark/fractality/commit/79b0fd6634ec319c7f6e8dcaebd385ee2a8181a3))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add files allowlists and exports maps to all packages ([298d693](https://github.com/sitepark/fractality/commit/298d69391c96b5a2c6751eb87653b17796d36ab9))
|
|
17
|
+
|
|
6
18
|
## 2.2.3 (2024-09-24)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @fractality/nunjucks
|
|
@@ -19,25 +31,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
31
|
|
|
20
32
|
### Bug Fixes
|
|
21
33
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
34
|
+
- **engine:** update to remove deprecated flatten behaviour ([b89be05](https://github.com/frctl/fractal/commit/b89be05f091c9eb61b14c510b91eb3c548b849cd))
|
|
35
|
+
- fetch request context for README.md ([#13](https://github.com/frctl/fractal/issues/13)) ([dec6fea](https://github.com/frctl/fractal/commit/dec6feae727801f5a61291cd8cd1e167b37bee18))
|
|
24
36
|
|
|
25
37
|
### Features
|
|
26
38
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
39
|
+
- **partials:** support new handle-based import syntax ([2719df7](https://github.com/frctl/fractal/commit/2719df71a1e385b21a5c8d0cfb5be173e68269ad))
|
|
40
|
+
- replace bluebird with native promises ([1c8daa0](https://github.com/frctl/fractal/commit/1c8daa09a70962211ce550eff9a930ee3d9a9323))
|
|
29
41
|
|
|
30
42
|
# 2.1.0 (2024-03-19)
|
|
31
43
|
|
|
32
44
|
### Bug Fixes
|
|
33
45
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
46
|
+
- **engine:** update to remove deprecated flatten behaviour ([b89be05](https://github.com/frctl/fractal/commit/b89be05f091c9eb61b14c510b91eb3c548b849cd))
|
|
47
|
+
- fetch request context for README.md ([#13](https://github.com/frctl/fractal/issues/13)) ([dec6fea](https://github.com/frctl/fractal/commit/dec6feae727801f5a61291cd8cd1e167b37bee18))
|
|
36
48
|
|
|
37
49
|
### Features
|
|
38
50
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
51
|
+
- **partials:** support new handle-based import syntax ([2719df7](https://github.com/frctl/fractal/commit/2719df71a1e385b21a5c8d0cfb5be173e68269ad))
|
|
52
|
+
- replace bluebird with native promises ([1c8daa0](https://github.com/frctl/fractal/commit/1c8daa09a70962211ce550eff9a930ee3d9a9323))
|
|
41
53
|
|
|
42
54
|
## [2.0.15](https://github.com/frctl/fractal/compare/@frctl/nunjucks@2.0.14...@frctl/nunjucks@2.0.15) (2022-08-17)
|
|
43
55
|
|
|
@@ -95,31 +107,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
95
107
|
|
|
96
108
|
### Bug Fixes
|
|
97
109
|
|
|
98
|
-
-
|
|
110
|
+
- fetch request context for component notes file (#13)
|
|
99
111
|
|
|
100
112
|
### Chores
|
|
101
113
|
|
|
102
|
-
-
|
|
114
|
+
- bump lodash from 4.17.11 to 4.17.13 (#14)
|
|
103
115
|
|
|
104
116
|
## 2.0.1
|
|
105
117
|
|
|
106
|
-
-
|
|
118
|
+
- Fix issue with `render`and `view` tag output being escaped
|
|
107
119
|
|
|
108
120
|
## 2.0
|
|
109
121
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
122
|
+
- Update Nunjucks to v3.x
|
|
123
|
+
- Prevent array merging in `render` tag context data
|
|
124
|
+
- Enable autoescaping by default
|
|
125
|
+
- Add ability to provide environment configuration options
|
|
114
126
|
|
|
115
127
|
## 1.0.2
|
|
116
128
|
|
|
117
|
-
-
|
|
129
|
+
- [FIX] Fix issue with path filter in components rendered using the `render` extension.
|
|
118
130
|
|
|
119
131
|
## 1.0.1
|
|
120
132
|
|
|
121
|
-
-
|
|
122
|
-
-
|
|
133
|
+
- Provide support for future changes to `_` ('special') variables setting
|
|
134
|
+
- Update Nunjucks 2.3.0 -> 2.4.2
|
|
123
135
|
|
|
124
136
|
## 1.0.0
|
|
125
137
|
|
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## 🚨 Breaking changes in v2.0
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- `render` tag - Arrays in context data are **no longer merged** with those in the default component context
|
|
10
|
+
- **Autoescaping** - this is now **disabled by default**. Preview templates will need to be updated to mark the `yield` output as safe using the Nunjucks `safe` filter: `{{ yield | safe }}`. Alternatively this can be enabled globally again using the environment options when [configuring the adapter](#customisation) (not recommended).
|
|
11
|
+
- **Nunjucks version** - bumped to 3.x
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fractality/nunjucks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nunjucks template adapter for Fractalility.",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"index.js",
|
|
16
|
+
"CHANGELOG.md"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.0.0"
|
|
20
|
+
},
|
|
7
21
|
"repository": {
|
|
8
22
|
"type": "git",
|
|
9
23
|
"url": "https://github.com/sitepark/fractality.git",
|
|
@@ -19,15 +33,15 @@
|
|
|
19
33
|
"@fractality/fractality": ">= 1.5 < 2"
|
|
20
34
|
},
|
|
21
35
|
"dependencies": {
|
|
22
|
-
"@fractality/core": "0.
|
|
23
|
-
"lodash": "^4.
|
|
36
|
+
"@fractality/core": "0.6.0",
|
|
37
|
+
"lodash": "^4.18.1",
|
|
24
38
|
"nunjucks": "^3.2.4"
|
|
25
39
|
},
|
|
26
40
|
"devDependencies": {
|
|
27
|
-
"@fractality/fractality": "1.
|
|
41
|
+
"@fractality/fractality": "1.7.0"
|
|
28
42
|
},
|
|
29
43
|
"publishConfig": {
|
|
30
44
|
"access": "public"
|
|
31
45
|
},
|
|
32
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "c067f18e528fab0b9b90e8dabe59d3fe5e1b9371"
|
|
33
47
|
}
|
package/src/extensions/render.js
CHANGED
|
@@ -34,19 +34,19 @@ export default function (fractality) {
|
|
|
34
34
|
context = utils.defaultsDeep(context, defaultContext);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
source
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.
|
|
43
|
-
.then((html) => {
|
|
37
|
+
source
|
|
38
|
+
.resolve(context)
|
|
39
|
+
.then((context) => {
|
|
40
|
+
// fix env for rendered components
|
|
41
|
+
let env = JSON.parse(JSON.stringify(rootContext._env));
|
|
42
|
+
context._env = env;
|
|
43
|
+
return entity.render(context).then((html) => {
|
|
44
44
|
callback(null, new nunjucks.runtime.SafeString(html));
|
|
45
|
-
})
|
|
46
|
-
.catch((err) => {
|
|
47
|
-
callback(err);
|
|
48
45
|
});
|
|
49
|
-
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
callback(err);
|
|
49
|
+
});
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|