Skip to content

Releases: Jahia/javascript-modules

JavaScript Modules v1.1.0

30 Dec 12:56

Choose a tag to compare

New Features

  • useGQLQuery now accepts an optionally typed GraphQL document for its query parameter. (#548)

    This enables compatibility with GraphQL libraries such as gql.tada and GraphQL Codegen.

  • Enabled buildNodeUrl support for Java decorators by using the underlying node.getUrl() Java implementation. (#549)

    Example: buildNodeUrl(imageNode, { args: { width: 640 } }) will execute imageNode.getUrl(['width:640']).

  • Enabled jahia-deploy support for custom context in the JAHIA_HOST env var. (#551)

  • Improved the type declaration of <Render> to prevent runtime errors. (#571)

    We have not changed the implementation of <Render>, only its type declaration. If you encounter red squiggles on <Render>, your code will behave exactly the same as before, but it might mean you use mutually exclusive parameters, and one of them is ignored, or that you are missing a required parameter that gets a temporary value at runtime.

Other Changes

  • GraalVM runtime libraries (the Java code that runs JavaScript code) are now embedded in the JavaScript Modules Engine instead of Jahia core. (#601, #609, #610)

    This does not change anything if you are using JavaScript Modules, but makes the core slightly lighter for Java-only Jahia stacks.

    This change is coordinated with the upcoming release of Jahia 8.2.3.0: future versions of Jahia will require the JavaScript Modules Engine in version 1.1.0 or greater for JavaScript Modules to work.

  • All embedded libraries were upgraded to their latest version:

    Library Version in JSM 1.0.1 Version in JSM 1.1.0
    react 19.2.0 19.2.3
    react-dom 19.2.0 19.2.3
    i18next 25.6.0 25.7.3
    react-i18next 16.1.0 16.5.0

    To make analyzing embedded library version easier for you, we now resort to exact dependency versions: javascript-modules-engine/package.json

  • All of our npm packages are now published with a provenance certificate, certifying that packages were built and published from a trusted environment.

    We are making efforts to minimize the possibility of supply-chain attacks: please distrust all Jahia packages without a provenance certificate from now on.

Full Changelog: 1_0_1...1_1_0

JavaScript Modules v1.0.1

20 Oct 16:10

Choose a tag to compare

This release only contains bug fixes.

Bug Fixes

  • The name in package.json can now be overriden by jahia.name to allow a wider range of characters. (#525)
  • Enabled support for yarn create @jahia/module. (#527)
  • Bumped React to 19.2.0.
  • Expose react-dom as a shared library. (#522)
  • Type JCR-SQL2 query results as JCRNodeWrapper. (#538)
  • Allow both react-i18next 15 and 16. (#541)

Full Changelog: 1_0_0...1_0_1

JavaScript Modules v1.0.0 🎉

03 Oct 09:10

Choose a tag to compare

JavaScript Modules are now considered stable! This also means that no breaking changes are coming in the foreseeable future.

Breaking Changes

  • Deprecated RenderInBrowser and HydrateInBrowser were replaced by <Island />. (#497)

    Please read the 0.9 release notes for migration details.

Bug Fixes

  • Running JSM engine on bare metal Windows is now expected to work properly. (#504, #511)

  • Client and server build must both complete to run the yarn watch:callback command. (#490)

Other Changes

  • The npm create @jahia/module@latest command creates a slightly smaller Hello World. (#501)

  • The JSM engine now ships with React 19.2.0. (#513)

Full Changelog: 0_9_2...1_0_0

JavaScript Modules v0.9.2

16 Sep 15:32

Choose a tag to compare

Bug Fixes

  • Ensure all builds (client and server) succeed before running the yarn watch:callback command (#492)

  • Add a health check to postgres in the docker-compose.yml of the create module (#494)

Full Changelog: 0_9_1...0_9_2

JavaScript Modules v0.9.1

11 Sep 17:01

Choose a tag to compare

Bug Fixes

  • Ensure hydration paths are resolved correctly on Windows (#484)

Full Changelog: 0_9_0...0_9_1

JavaScript Modules v0.9.0 🏝️

04 Sep 13:58

Choose a tag to compare

This is the last release before the v1!

Breaking Changes

  • <Island /> is the new client-side component, replacing <HydrateInBrowser /> and <RenderInBrowser />. (#447)

    To migrate, replace <HydrateInBrowser child={Comp} ... /> with <Island component={Comp} ... /> and <RenderInBrowser child={Comp} ... /> with <Island clientOnly component={Comp} ... />.

    The documentation for this new component is already available on the Academy!

    This change aligns with Island Architecture, and hides the implementation details: the fact that islands are hydrated is true in React 19, but might change in the future if React changes paradigm.

    Note: HydrateInBrowser and RenderInBrowser are deprecated, and will be removed in the next major version. This 0.9 version acts as a migration window before the v1.

  • Server-side dist bundle now uses standard ESM imports instead of a custom library sharing mechanism. (#463)

    This does not change anything for your code but requires re-building your JavaScript Modules with the latest version of the Vite plugin.

Removed deprecated APIs:

  • Removed defineJahiaComponent and registerJahiaComponents, use jahiaComponent instead. (#421)

  • Removed areaView, allowedTypes and areaType from <(Absolute)Area /> components. Use view, allowedNodeTypes and nodeType instead. (#421)

  • Updated <AddContentButtons /> to only accept nodeTypes as an array of strings. (#421)

Bug Fixes

  • GraphQL query results are now properly encoded. (#422)

Dependency Bumps

The following embedded dependencies were bumped:

Dependency Version
react 19.1.1
i18next 25.4.2
react-i18next 15.7.3

Full Changelog: 0_8_0...0_9_0

JavaScript Modules v0.8.0 📦

23 Jul 12:17

Choose a tag to compare

This release adds support for Vite-powered asset bundling.

Breaking Changes

  • The Vite plugin no longer inlines all resources! This is an important change for both performance and security. (#275)

    What it means in practice is that instead of two output folders (client and server), there are now three output folders:

    • server: contains a single JS file to run on the server
    • client: contains all JS files used for hydration
    • assets: contains a single CSS file (style.css), with resources referenced in CSS and JS files (fonts, images...)

    Assets will be deduplicated between client and server builds.

    The configuration structure of the plugin changed to reflect this new folder. Here is the new default configuration:

    jahia({
      inputDir: "src",
      outputDir: "dist",
      assetsDir: "assets", // Computed as dist/assets
      client: {
        inputGlob: "**/*.client.{jsx,tsx}", // Computed as src/**/*.client.{jsx,tsx}
        outputDir: "client", // Computed as dist/client
      },
      server: {
        inputGlob: "**/*.server.{jsx.tsx}", // Computed as src/**/*.server.{jsx,tsx}
        outputFile: "server/index.js", // Computed as dist/server/index.js
      },
    })

    If you follow our conventions regarding file names (see the globs above), you can safely remove all pre-0.8 configuration settings.

    You will need to update your CSS import: <AddResources type="css" resources={buildModuleFileUrl("dist/assets/style.css")} /> (assets instead of server)

    You may now restrict web-accessible resources in your package.json: "static-resources": "/dist/client,/dist/assets"

  • The jahia-deploy CLI has been rewritten to improve the development experience: CND breaking change validation is now skipped during development, allowing easier prototyping. The new CLI always uses the provisioning API. (#378)

  • Hydration markers now use custom elements instead of <div>s to prevent invalid HTML. All custom elements are prefixed by jsm- to avoid collisions. The new elements used are jsm-hydrate, jsm-render and jsm-children. (#386)

New Features

  • The npm create @jahia/module@latest CLI has been revamped to offer different templates to start your integration with. (#407)

    You can now choose between 3 different bases:

    • A minimal Hello World template set (this was the only available base previously)
    • An empty template set
    • An empty module

    Newly created modules now ship with a docker-compose.yml file to ease the creation process of a local Jahia instance. (#364)

  • RenderChild and RenderChildren now accept a nodeTypes prop, used in page builder to restrict the node types that can be added as children. (#379)

  • Vite 7 is now officially supported! (#387)

  • buildModuleFileUrl keeps base64 URLs untouched instead of crashing. This features pairs well with Vite's assets handling. (#394)

Embedded JS Packages

No breaking changes here, we bumped JSM dependencies to the following versions:

  • react: 19.1.0
  • i18next: 25.3.2
  • react-i18next: 15.6.0

Full Changelog: 0_7_2...0_8_0

JavaScript Modules v0.7.2

12 Jun 07:25

Choose a tag to compare

This is a re-release of JSM 0.7.1, as the previous version has signature issues.

JavaScript Modules v0.7.1

04 Jun 15:29

Choose a tag to compare

This is a small developer experience release:

  • New JavaScript Modules are created with a docker-compose.yml file to start Jahia more easily. (#320)

    Use npm init @jahia/module to create a new module with the improved local setup, or copy the file from GitHub.

  • Performance: insert <link rel="modulepreload"> to improve client-side JS load performance. (#349)

Full Changelog: 0_7_0...0_7_1

JavaScript Modules v0.7.0 ☕️

14 May 09:37

Choose a tag to compare

This release adds support for JS<->Java interactions through OSGi services.

New Features

  • JS code can interact with Java code through OSGi services. Usage looks roughly like this:

    import { jahiaComponent, server } from "@jahia/javascript-modules-library";
    
    jahiaComponent(
      {
        nodeType: "javascriptExample:testOSGi",
        name: "default",
        componentType: "view",
      },
      () => <p>{server.osgi.getService("org.example.services.SimpleService").sayHello("World")}</p>,
    );

    The documentation will be updated shortly with more details on how to use this feature. In the meantime, you can check #294 for more examples. If you have feedback on this feature, please reach out to us: calendar.app.google/LigWTiUSDeHmVCwa7

  • JS client files are now minified. This should save up to 1 MB of client-side JavaScript for cold page loads! #269

  • process.env.NODE_ENV is now replaced during the build. This change makes JavaScript Modules more compatible with the rest of the Node.js ecosystem. #263

  • Sourcemaps are generated by default in development mode. #272

Breaking Changes

  • buildNavMenu has been removed. #282

Dependency Updates (#299)

All runtime dependencies have been updated to the latest versions. This includes:

  • i18next: 23.10.1 → 25.0.2 (🚨 Check i18next.com/misc/migration-guide for breaking changes affecting you)
  • react: 19.0.0 → 19.1.0
  • react-i18next: 15.4.0 → 15.5.1
  • styled-jsx: 5.1.6 → 5.1.7

Other Changes

  • All packages of this monorepo are now published to maven/npmjs.com on every commit. You can check the versions tab to install pre-release versions. Be careful, pre-releases do not go through our QA step. #254 and #281
  • You should no longer experience issues with jExperience and page-level personalization. #295
  • GraalVM is now correctly detected. #293

Full Changelog: 0_6_1...0_7_0