diff --git a/.chachalog/.version b/.chachalog/.version index 26aaba0e8..589268e6f 100644 --- a/.chachalog/.version +++ b/.chachalog/.version @@ -1 +1 @@ -1.2.0 +1.3.0 \ No newline at end of file diff --git a/.chachalog/B5LNULyZ.md b/.chachalog/B5LNULyZ.md deleted file mode 100644 index fb0600a82..000000000 --- a/.chachalog/B5LNULyZ.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -We have migrated our build pipelines and test suites to Vite 8 and Rolldown to ensure JS Modules work with the latest versions of this stack. (#668) - -This is not a breaking change, we support all Vite versions from 6 to 8. diff --git a/.chachalog/BcOA3_X-.md b/.chachalog/BcOA3_X-.md deleted file mode 100644 index 2b5df5deb..000000000 --- a/.chachalog/BcOA3_X-.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -Handle GraphQL subrequests correctly. (#681) diff --git a/.chachalog/Dp4sWq9L.md b/.chachalog/Dp4sWq9L.md deleted file mode 100644 index 180acc09d..000000000 --- a/.chachalog/Dp4sWq9L.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -`jahia-deploy` now fails when Jahia installs nothing, instead of printing `{}` and exiting successfully. diff --git a/.chachalog/Hv3Qm8Lp.md b/.chachalog/Hv3Qm8Lp.md deleted file mode 100644 index 1d3a14279..000000000 --- a/.chachalog/Hv3Qm8Lp.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -`npm init @jahia/module` can now scaffold a project without a single prompt, which makes it usable from scripts, CI pipelines and coding agents: (#715) - -```bash -npm init @jahia/module@latest my-module -- --template hello-world --yes -``` diff --git a/.chachalog/Hy7dRc2w.md b/.chachalog/Hy7dRc2w.md deleted file mode 100644 index 28b95d1fb..000000000 --- a/.chachalog/Hy7dRc2w.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -Fixed client-only islands being hydrated instead of rendered in the browser, which logged a hydration error in the console for each island. (#807) diff --git a/.chachalog/Kp7mQx2R.md b/.chachalog/Kp7mQx2R.md deleted file mode 100644 index 198f3ac84..000000000 --- a/.chachalog/Kp7mQx2R.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: minor ---- - -`buildNodeUrl` now autocollects cache dependencies for the content it links to, preventing 404 errors when the linked content is renamed or moved. (#783, #810) - -This mechanism is enabled by default but can be disabled on a per-view basis by setting `"cache.autocollectDependencies": "false"` in the view's properties, or on a per-call basis with the new `autocollectDependency: false` option in `buildNodeUrl`. - -When a view links to more than 100 contents, a change in a folder that holds many of them also refreshes the view. diff --git a/.chachalog/NIF1LOWq.md b/.chachalog/NIF1LOWq.md deleted file mode 100644 index 39e30642b..000000000 --- a/.chachalog/NIF1LOWq.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: minor ---- - -Introduced `` and `getImageProps` to render responsive images from an image node: `srcset` and `sizes` are derived from the image's intrinsic size, `alt` falls back to the image title, and `width` / `height` are set to prevent layout shifts. (#789) - -On a default Jahia instance every candidate serves the original file. A DAM (Cloudinary, Keepeek) or an image resizer (Cloudimage) is required for the resizing to take effect. diff --git a/.chachalog/Qe7vKp3T.md b/.chachalog/Qe7vKp3T.md deleted file mode 100644 index 1f2de09d6..000000000 --- a/.chachalog/Qe7vKp3T.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -`buildNodeUrl` default mode detection has been improved to preserve links within the editframe in `edit` mode. Other modes are unaffected. (#788) diff --git a/.chachalog/RFsycdD5.md b/.chachalog/RFsycdD5.md deleted file mode 100644 index 631ba550a..000000000 --- a/.chachalog/RFsycdD5.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -javascript-modules: patch ---- - -Fixed absolute areas with `readOnly="children"` so they can be edited on their owning page. (#679) diff --git a/.chachalog/Xk3uCdUu.md b/.chachalog/Xk3uCdUu.md deleted file mode 100644 index eabfc31d0..000000000 --- a/.chachalog/Xk3uCdUu.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: patch ---- - -`server.render.addCacheDependency({ uuid }, renderContext)` now correctly registers the dependency, instead of doing nothing. (#792) diff --git a/.chachalog/Z1H81Psm.md b/.chachalog/Z1H81Psm.md deleted file mode 100644 index 8848f901b..000000000 --- a/.chachalog/Z1H81Psm.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: minor ---- - -Added support for children in client-only islands: `` now passes its children to the component. (#807) - -Use `clientOnly="hide-children-while-loading"` to hide them until the component is loaded, for instance when they must only be displayed in a modal. - -If an existing client-only component renders its `children`, the placeholder now ends up inside it, and it must match the type of the component's `children` prop. diff --git a/.chachalog/oFKFbxW6.md b/.chachalog/oFKFbxW6.md deleted file mode 100644 index 2b40d1e0e..000000000 --- a/.chachalog/oFKFbxW6.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: minor ---- - -Bumped embedded dependencies. (#658, #664, #793) - -| Dependency | From (JSM 1.2.0) | To (JSM 1.3.0) | -| ------------- | ---------------- | -------------- | -| devalue | 5.6.4 | 6.0.0 | -| i18next | 25.7.3 | 26.4.2 | -| react | 19.2.3 | 19.3.0 | -| react-dom | 19.2.3 | 19.3.0 | -| react-i18next | 16.5.0 | 17.0.14 | - -We decided to upgrade i18next and react-i18next in a minor version because, as far as we're aware, the breaking changes remove deprecated features that were never put in place in recent codebases. If this assumption is incorrect, please reach out to us. diff --git a/.chachalog/vdng1uYC.md b/.chachalog/vdng1uYC.md deleted file mode 100644 index a9158f46e..000000000 --- a/.chachalog/vdng1uYC.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -# Allowed version bumps: patch, minor, major -javascript-modules: minor ---- - -Added an `absolute` option to `buildEndpointUrl`, `buildNodeUrl` and `buildModuleFileUrl`, which prefixes the URL with the server origin or with an origin passed as a string. - -```jsx - -``` - -In preview and edit, Jahia removes the origin from a page URL in an `href` or `src` attribute, so use the URL in an attribute such as `content` there. diff --git a/.chachalog/yPTfYT6r.md b/.chachalog/yPTfYT6r.md deleted file mode 100644 index 34163ab0c..000000000 --- a/.chachalog/yPTfYT6r.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -javascript-modules: minor ---- - -Expose `JCRStoreProvider` in TypeScript types. (#790) diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..6b295510a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,67 @@ +# javascript-modules Changelog + +## 1.3.0 + +### New Features + +* `buildNodeUrl` now autocollects cache dependencies for the content it links to, preventing 404 errors when the linked content is renamed or moved. (#783, #810) + + This mechanism is enabled by default but can be disabled on a per-view basis by setting `"cache.autocollectDependencies": "false"` in the view's properties, or on a per-call basis with the new `autocollectDependency: false` option in `buildNodeUrl`. + + When a view links to more than 100 contents, a change in a folder that holds many of them also refreshes the view. + +* Introduced `` and `getImageProps` to render responsive images from an image node: `srcset` and `sizes` are derived from the image's intrinsic size, `alt` falls back to the image title, and `width` / `height` are set to prevent layout shifts. (#789) + + On a default Jahia instance every candidate serves the original file. A DAM (Cloudinary, Keepeek) or an image resizer (Cloudimage) is required for the resizing to take effect. + +* Added support for children in client-only islands: `` now passes its children to the component. (#807) + + Use `clientOnly="hide-children-while-loading"` to hide them until the component is loaded, for instance when they must only be displayed in a modal. + + If an existing client-only component renders its `children`, the placeholder now ends up inside it, and it must match the type of the component's `children` prop. + +* Bumped embedded dependencies. (#658, #664, #793) + + | Dependency | From (JSM 1.2.0) | To (JSM 1.3.0) | + | ------------- | ---------------- | -------------- | + | devalue | 5.6.4 | 6.0.0 | + | i18next | 25.7.3 | 26.4.2 | + | react | 19.2.3 | 19.3.0 | + | react-dom | 19.2.3 | 19.3.0 | + | react-i18next | 16.5.0 | 17.0.14 | + + We decided to upgrade i18next and react-i18next in a minor version because, as far as we're aware, the breaking changes remove deprecated features that were never put in place in recent codebases. If this assumption is incorrect, please reach out to us. + +* Added an `absolute` option to `buildEndpointUrl`, `buildNodeUrl` and `buildModuleFileUrl`, which prefixes the URL with the server origin or with an origin passed as a string. + + ```jsx + + ``` + + In preview and edit, Jahia removes the origin from a page URL in an `href` or `src` attribute, so use the URL in an attribute such as `content` there. + +* Expose `JCRStoreProvider` in TypeScript types. (#790) + +### Bug Fixes + +* We have migrated our build pipelines and test suites to Vite 8 and Rolldown to ensure JS Modules work with the latest versions of this stack. (#668) + + This is not a breaking change, we support all Vite versions from 6 to 8. + +* Handle GraphQL subrequests correctly. (#681) + +* `jahia-deploy` now fails when Jahia installs nothing, instead of printing `{}` and exiting successfully. + +* `npm init @jahia/module` can now scaffold a project without a single prompt, which makes it usable from scripts, CI pipelines and coding agents: (#715) + + ```bash + npm init @jahia/module@latest my-module -- --template hello-world --yes + ``` + +* Fixed client-only islands being hydrated instead of rendered in the browser, which logged a hydration error in the console for each island. (#807) + +* `buildNodeUrl` default mode detection has been improved to preserve links within the editframe in `edit` mode. Other modes are unaffected. (#788) + +* Fixed absolute areas with `readOnly="children"` so they can be edited on their owning page. (#679) + +* `server.render.addCacheDependency({ uuid }, renderContext)` now correctly registers the dependency, instead of doing nothing. (#792)