@fractality/nunjucks 2.2.2 → 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 +34 -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,22 @@
|
|
|
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
|
+
|
|
18
|
+
## 2.2.3 (2024-09-24)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @fractality/nunjucks
|
|
21
|
+
|
|
6
22
|
## 2.2.2 (2024-09-20)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @fractality/nunjucks
|
|
@@ -15,25 +31,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
15
31
|
|
|
16
32
|
### Bug Fixes
|
|
17
33
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
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))
|
|
20
36
|
|
|
21
37
|
### Features
|
|
22
38
|
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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))
|
|
25
41
|
|
|
26
42
|
# 2.1.0 (2024-03-19)
|
|
27
43
|
|
|
28
44
|
### Bug Fixes
|
|
29
45
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
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))
|
|
32
48
|
|
|
33
49
|
### Features
|
|
34
50
|
|
|
35
|
-
-
|
|
36
|
-
-
|
|
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))
|
|
37
53
|
|
|
38
54
|
## [2.0.15](https://github.com/frctl/fractal/compare/@frctl/nunjucks@2.0.14...@frctl/nunjucks@2.0.15) (2022-08-17)
|
|
39
55
|
|
|
@@ -91,31 +107,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
91
107
|
|
|
92
108
|
### Bug Fixes
|
|
93
109
|
|
|
94
|
-
-
|
|
110
|
+
- fetch request context for component notes file (#13)
|
|
95
111
|
|
|
96
112
|
### Chores
|
|
97
113
|
|
|
98
|
-
-
|
|
114
|
+
- bump lodash from 4.17.11 to 4.17.13 (#14)
|
|
99
115
|
|
|
100
116
|
## 2.0.1
|
|
101
117
|
|
|
102
|
-
-
|
|
118
|
+
- Fix issue with `render`and `view` tag output being escaped
|
|
103
119
|
|
|
104
120
|
## 2.0
|
|
105
121
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
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
|
|
110
126
|
|
|
111
127
|
## 1.0.2
|
|
112
128
|
|
|
113
|
-
-
|
|
129
|
+
- [FIX] Fix issue with path filter in components rendered using the `render` extension.
|
|
114
130
|
|
|
115
131
|
## 1.0.1
|
|
116
132
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
133
|
+
- Provide support for future changes to `_` ('special') variables setting
|
|
134
|
+
- Update Nunjucks 2.3.0 -> 2.4.2
|
|
119
135
|
|
|
120
136
|
## 1.0.0
|
|
121
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
|
|