Update dependency @inlang/paraglide-js to v3 #122

Open
renovate wants to merge 1 commit from renovate/inlang-paraglide-js-3.x into develop
Collaborator

This PR contains the following updates:

Package Type Update Change
@inlang/paraglide-js (source) devDependencies major ^2.15.0 → ^3.0.0

Release Notes

generaltranslation/paraglide-js (@​inlang/paraglide-js)

v3.5.0

Minor Changes
  • 8eb79fe: paraglide-js init sets up SvelteKit, including SvelteKit 3 projects without a svelte.config:
    • The default output directory is ./src/lib/paraglide, the same as npx sv add paraglide.
    • The Vite plugin gets strategy: ["url", "cookie", "baseLocale"], so localized URLs such as /de/about work. After npx sv add paraglide, init adds the strategy to sv's plugin call and keeps the rest. A strategy set in project.inlang/paraglide.config.* is kept.
    • init links to the hook steps in the SvelteKit guide.
Patch Changes
  • 06c1d81: The generated server.js now type-checks in projects without @types/node, such as a new SvelteKit app, where svelte-check reported "Cannot find name 'async_hooks'".

v3.4.0

Minor Changes
  • e7b9d05: The first compile of a dev server or paraglide-js compile run now says how many translations are missing and how to fill them, on the same log line:

    ✔ [paraglide-js] Compilation complete (locale-modules) · 6 missing translations in de. Fill them with: npx @inlang/cli machine translate --project ./project.inlang
    

    It appears at most once per process, only when a locale lacks messages of the base locale and nothing in its fallback chain (de-CH → de) has them, and never in CI or production builds. Set PARAGLIDE_MISSING_TRANSLATIONS_HINT=false to turn it off.

Patch Changes
  • 1550852: When paraglide-js init runs without a terminal, as under a coding agent, its error now suggests --machine-translation gt along with --yes, so unattended setup can include machine translation with General Translation.

v3.3.0

Minor Changes
  • 2447045: init asks which machine translation provider the project should use. Choosing General Translation adds a machine-translate script that runs inlang machine translate --provider gt, so teammates and CI use it too, and --machine-translation gt chooses it without prompts. init adds @inlang/cli ^3.8.0, updates the ^3.0.0 or ^3.4.0 range an earlier init added when General Translation is chosen, and keeps existing provider choices and scripts it didn't write.
Patch Changes
  • 9ff2e5d: Evaluate custom server strategies in their configured order in extractLocaleFromRequestAsync and paraglideMiddleware. Before, a custom strategy always took precedence over built-in strategies listed before it, such as url or cookie.

    To keep the old behaviour, list your custom strategy first. With the default URL patterns, url resolves a locale for every path, so a custom strategy listed after it never runs.

  • c90030f: Escape ${ in compiled messages when the $ and { come from separate text parts, or from text on either side of markup that is stripped in string output. Before, a pattern like cost $ followed by {1 + 1} compiled to a live template literal substitution.

  • edc2576: Don't reload Vite environments when the first virtual message output is published in buildStart. Vite buffered that full-reload and replayed it to the first browser that connected, so the first page opened after vite dev started reloaded itself. Replacing the virtual output and editing messages still reload.

  • 99a4a91: Apply the configured trailingSlash policy to the catch-all fast path of localizeUrl and deLocalizeUrl. Previously localizeHref("/", { locale: "en" }) returned /en/ with trailingSlash: "never" because the fast path returned before normalization.

  • a5af446: The README in the compiled output now recommends General Translation for translating messages, through the inlang CLI's machine translation (npx @inlang/cli machine translate --no-browser).

  • 479e764: Exit paraglide-js init when a prompt is cancelled with Ctrl+C. Previously consola resolved a cancelled prompt with its default answer, so setup continued as if the default had been chosen.

  • 9bd62b1: paraglide-js init now double-quotes paths with spaces in the package.json scripts it writes (build, check:i18n, machine-translate), so they also run under npm's default Windows shell, cmd.exe, which doesn't treat single quotes as quotes.

  • bdb4f36: License under MIT with copyright General Translation, Inc. The framework packages now include the LICENSE file in their npm package.

  • 05a3df3: Use locale modules by default in Vite dev servers and Vitest to avoid one HTTP request per message in large catalogs. Keep virtual modules for Vite builds, preserve explicit layout overrides, and retain generated TypeScript declarations for the default layouts.

  • ecb7914: Keep the virtual-modules optimization when a message is read in a destructuring default value, such as let { text = m.hello() } = $props() in Svelte 5 server output. Before, any m.key below an AssignmentPattern made the file fall back to importing the whole message barrel.

  • 6e69650: Fix Vitest reusing stale cached transforms of rewritten message imports after outputStructure changes outside the Vite config file. The plugin now registers a Vitest cache key (defineCacheKeyGenerator) derived from the effective virtual output and its message ids.

v3.2.2

Patch Changes
  • 4445e45: Preserve Vite's SSR detection expression when resolving compiler defaults, while respecting explicit plugin and config overrides. Keep the generated isServer declaration typed as boolean for the Vite expression.

v3.2.1

Patch Changes
  • 6024837: Normalize filesystem module IDs returned by virtual messages on Windows and resolve physical imports through Vite so its symlink settings are respected. This prevents duplicate runtime instances that caused SSR and prerendered messages to use the base locale instead of the request locale.

    Preserve Windows UNC network-share prefixes when normalizing configuration and watch paths. Handle trailing separators in directory containment checks so config edits reload correctly at UNC share roots, drive roots, and POSIX roots.

v3.2.0

Minor Changes
  • 4045ec4: Add lazyUrlPatternPolyfill: true to load the URLPattern polyfill only when it is missing in generated runtimes with custom URL patterns or route strategies. This uses conditional top-level await and requires Vite 7+ or another ESM toolchain and runtime supporting top-level await. The option defaults to false, preserving the static polyfill import. Routing APIs remain synchronous.

v3.1.0

Minor Changes
  • 4687696: Include shared bundle descriptions in generated JavaScript JSDoc and TypeScript declarations. Description edits refresh generated documentation, multiline guidance is escaped safely, and descriptions stay out of runtime message metadata and translated text.

    Description ingestion requires the coordinated inlang SDK 4.2 release and description-capable format plugins. Formats without native metadata use the SDK-managed project companion file.

v3.0.0

Major Changes
  • f65ba59: Remove the additionalFiles compiler option in Paraglide JS 3. Custom files and overrides of generated files are no longer supported through this option. Existing JavaScript configurations using it fail with migration guidance instead of silently dropping those files.

    Remove additionalFiles from your compiler, bundler plugin, or paraglide.config.* options. Keep framework helpers and message re-export wrappers in your application source, outside Paraglide's generated output directory. Manage extra assets, metadata, and source maps through your own build tooling. Paraglide continues to generate declarations for its own output when emitTsDeclarations is enabled.

    Allow Paraglide JS 3 in the framework helper packages’ peer dependency ranges.

    The CLI emits declarations by default (use --no-emit-ts-declarations to disable them). Init explicitly enables declaration emission in generated Vite integrations, compile scripts, and its initial compilation, and no longer reads or changes tsconfig.json to enable allowJs. The programmatic compiler and bundler plugin option default remains emitTsDeclarations: false.

    Use the SDK catalog entry point directly, removing the older SDK database-loading fallback and compatibility detection. Remove the unused deprecated NodeishFilesystem type. The public createParaglide() API remains available.

  • 05a3e17: Remove experimentalMiddlewareLocaleSplitting for Paraglide v3, including its compiler option, runtime message tracking, and middleware HTML script injection. Generated runtimes no longer export trackMessageCall or experimentalMiddlewareLocaleSplitting, and async local storage no longer tracks message calls.

    Per-locale builds are the recommended way to ship only the active locale's messages. Remove experimentalMiddlewareLocaleSplitting from your configuration and use experimentalPerLocaleBuild: true for supported Vite applications. Per-locale builds require full-document navigation when switching locales and a deployment that selects the matching locale output. See the per-locale build guide for framework and deployment constraints.

  • eb5dc1d: Add outputStructure: "virtual-modules" and make it the default for the Vite
    integration in development and production. Keep public
    runtime/message entry points on disk, combine message declarations, and serve
    individual message implementations virtually. Safe static message imports avoid
    loading the complete message barrel while preserving per-message tree shaking.

    This layout requires the Vite plugin. Select outputStructure: "message-modules"
    or "locale-modules" explicitly for physical message files, standalone Node
    scripts or grouped output. CLI and other bundler defaults remain unchanged.

Minor Changes
  • f09ced5: Require SDK 4.1.0 and use its stateful createCatalogLoader() for directory compilation. Reuse the loader through previousCompilation, apply complete reset/update batches, and replace the unreleased snapshot catalog integration. Existing compileProject(), compileCatalog() and offline plugin caches remain supported.

    Reuse unchanged generated output and hashes. With the default one-message-per-module layout, translation and input edits compile only changed bundles. Settings, plugin, key-set, option and shared-layout changes use the full emitter as needed; unchanged catalogs reuse output for all layouts. Serialize concurrent compiles and invalidate consumed loader state and disk hashes after publication failures so retries restore missing files. Invalidate Vite's transform cache before error-recovery reloads to serve fresh translations.

    Retain opt-in messageModuleSize grouping for message-modules output, including --message-module-size in the CLI. Groups preserve named exports, input types, metadata, documentation, and per-message tree shaking. The default remains one message per file; import grouped messages through messages.js because grouping changes direct generated module paths.

  • 565b11b: Generate .d.ts files directly when emitTsDeclarations is enabled, removing TypeScript compiler analysis and the optional TypeScript peer dependency. TypeScript is no longer required to generate declarations.

    On a synthetic project with 6,400 messages and three locales, declaration generation takes 23 ms for message-modules and 26 ms for locale-modules, compared with 2.22 s and 2.54 s through TypeScript 7 (about 99% less time). The TypeScript 5 path takes 3.48 s and 20.03 s, respectively. These are medians of three runs on Node.js 22 and measure declaration generation only, excluding project loading, JavaScript generation, and final output writes.

    Generated declarations preserve boolean literals and common typeof comparisons for isServer. Other custom expressions have type any, allowing bundler-specific expressions without analyzing JavaScript.

  • 506efa1: Add a bundler-independent isDevelopment compiler expression for runtime diagnostics. Vite uses its resolved development/production mode; other bundler plugins default from NODE_ENV. Standalone compilation can disable diagnostics with isDevelopment: "false" or --is-development false.

    Make locale-specialized override warnings development-only and allow unused cookie-pattern setup to be tree-shaken. Keep the shared globalThis.__paraglide runtime object initialized for backward compatibility and future runtime behavior.

Patch Changes
  • 0d500bb: Read window.location.href in getLocale() only when a route strategy or the url strategy needs it. Every message call resolves the locale, and each read of window.location.href serializes the URL; getLocale() read it up to three times per call.
  • 4bdad54: Give every message and local variable its own identifier in the generated code. Keys that map to the same module id, like a.b and a_b, no longer overwrite each other: the key that is that id keeps it, and the others get an escaped id such as $a$2e$b. Messages named _index, eval or arguments, a formatted message named registry, and local variables named i, String, class or a-b no longer break the output. In grouped output, ids are unique within a shard, and the declaration barrel exports a type name two shards share under each key's escaped name. The registry is imported as __paraglideRegistry. Keys that don't collide keep their file, export and type names.
  • 9a44eb7: With outputStructure: "message-modules" and one message per module, messages/_index.d.ts declares every message itself instead of re-exporting one declaration file per message, so TypeScript reads one declaration file for messages.js. The per-message declarations remain for direct imports.
  • b2db911: Read existing output files concurrently when hashing the output directory. An unchanged start of the bundler plugins with physical output, and a CLI compile into an existing output directory, no longer read thousands of message modules one at a time.
  • dcac182: Escape line breaks in the quoted string literals the compiler emits, such as formatter option values and .local literals. A literal containing a line break made the generated module fail to parse.
  • 87d1360: Allow message-body inlining in per-locale builds using outputStructure: "message-modules", reducing generated client code while retaining locale selection, fallback behavior, and override warnings.
  • 49ff68f: Look up locales in toLocale() by their lowercased form instead of lowercasing every configured locale on each call. Calls that resolve their locale through the runtime's strategies paid one toLowerCase() per configured locale before the active one. The configured locales are treated as immutable, as their readonly type states.
  • 9436403: Grouped message modules (messageModuleSize above 1) no longer export their shared helper types. Every shard declared __ParaglideOptions, __ParaglideMessage and __ParaglideOptionalMessage, so messages.js exported them: a module that re-exported messages.js beside another export of those names failed with TS2308, and with two or more shards messages/_index.js (with checkJs) and messages/_index.d.ts (with skipLibCheck: false) failed because their export * exported the same names from every shard. The helpers are now declared once, in messages/_shard_types.js and .d.ts, which the barrel does not re-export, and each shard imports them type-only.
  • 4737859: Write catalog and option strings into generated code so they keep their exact value. An input name or match key containing */ no longer ends the generated JSDoc. localStorageKey, cookieName and cookieDomain may contain quotes, backslashes, $& or text of the runtime template, like <cookie-domain>. The fallback of an untranslated key with an apostrophe no longer breaks locale-modules output. Markup options and attributes named __proto__ are own properties of .parts() objects, and formatter options with a namespace or a dash, like u:locale, compile.
  • 2b999e4: Declarations that hold many messages in one file (messages.virtual.d.ts, and messages/_index.d.ts and the per-locale files of locale-modules) now refer to the runtime's MessageMetadata and MessagePart types through private shared aliases instead of an import("…") type per message. TypeScript locates each import() type by walking the file from its first statement, so creating the program took time quadratic in the number of messages.
  • 6f5ccc4: Read the locale of the default URL pattern from the URL that extractLocaleFromUrl() already parsed, instead of parsing it a second time. localizeHref() and localizeUrl() extract the locale of every link they localize.
  • 7525f9c: Rewrite const { key } = m (and other object patterns that read the namespace whole) and fully static template-literal keys such as m[`key`] to direct virtual message imports. Before, both kept the whole message barrel: in development every message module loaded, and a production build that destructured m bundled the entire catalog.
  • 7bcdae7: Rewrite the _unref(m).key reads that compiled Vue templates use (production builds inline the template into <script setup>) to direct virtual message imports. Vue's unref(x) returns x.value only when x.__v_isRef === true; every export of the message namespace is a message function, so none can be true, unref(m) is m, and these reads are static. Before, a Vue component that used m in its template kept the whole message barrel, and the production build bundled every message.
  • e32ee1e: Update every Vite environment when virtual messages change. A custom environment, such as a framework's runnable server environment, kept serving the previous translations after a catalog edit, because only the client and SSR module graphs were invalidated. Each environment's module graph is now invalidated and its hot channel notified, once. Vite 5, which has no environment API, keeps the previous behavior.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@inlang/paraglide-js](https://paraglidejs.com) ([source](https://github.com/generaltranslation/paraglide-js)) | devDependencies | major | [`^2.15.0` → `^3.0.0`](https://renovatebot.com/diffs/npm/@inlang%2fparaglide-js/2.29.3/3.5.0) | --- ### Release Notes <details> <summary>generaltranslation/paraglide-js (@&#8203;inlang/paraglide-js)</summary> ### [`v3.5.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#350) ##### Minor Changes - [`8eb79fe`](https://github.com/generaltranslation/paraglide-js/commit/8eb79fe): `paraglide-js init` sets up SvelteKit, including SvelteKit 3 projects without a `svelte.config`: - The default output directory is `./src/lib/paraglide`, the same as `npx sv add paraglide`. - The Vite plugin gets `strategy: ["url", "cookie", "baseLocale"]`, so localized URLs such as `/de/about` work. After `npx sv add paraglide`, `init` adds the strategy to sv's plugin call and keeps the rest. A strategy set in `project.inlang/paraglide.config.*` is kept. - `init` links to the hook steps in the SvelteKit guide. ##### Patch Changes - [`06c1d81`](https://github.com/generaltranslation/paraglide-js/commit/06c1d81): The generated `server.js` now type-checks in projects without `@types/node`, such as a new SvelteKit app, where `svelte-check` reported "Cannot find name 'async_hooks'". ### [`v3.4.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#340) ##### Minor Changes - [`e7b9d05`](https://github.com/generaltranslation/paraglide-js/commit/e7b9d05): The first compile of a dev server or `paraglide-js compile` run now says how many translations are missing and how to fill them, on the same log line: ``` ✔ [paraglide-js] Compilation complete (locale-modules) · 6 missing translations in de. Fill them with: npx @inlang/cli machine translate --project ./project.inlang ``` It appears at most once per process, only when a locale lacks messages of the base locale and nothing in its fallback chain (`de-CH` → `de`) has them, and never in CI or production builds. Set `PARAGLIDE_MISSING_TRANSLATIONS_HINT=false` to turn it off. ##### Patch Changes - [`1550852`](https://github.com/generaltranslation/paraglide-js/commit/1550852): When `paraglide-js init` runs without a terminal, as under a coding agent, its error now suggests `--machine-translation gt` along with `--yes`, so unattended setup can include machine translation with General Translation. ### [`v3.3.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#330) ##### Minor Changes - [`2447045`](https://github.com/generaltranslation/paraglide-js/commit/2447045): `init` asks which machine translation provider the project should use. Choosing General Translation adds a `machine-translate` script that runs `inlang machine translate --provider gt`, so teammates and CI use it too, and `--machine-translation gt` chooses it without prompts. `init` adds `@inlang/cli` `^3.8.0`, updates the `^3.0.0` or `^3.4.0` range an earlier `init` added when General Translation is chosen, and keeps existing provider choices and scripts it didn't write. ##### Patch Changes - [`9ff2e5d`](https://github.com/generaltranslation/paraglide-js/commit/9ff2e5d): Evaluate custom server strategies in their configured order in `extractLocaleFromRequestAsync` and `paraglideMiddleware`. Before, a custom strategy always took precedence over built-in strategies listed before it, such as `url` or `cookie`. To keep the old behaviour, list your custom strategy first. With the default URL patterns, `url` resolves a locale for every path, so a custom strategy listed after it never runs. - [`c90030f`](https://github.com/generaltranslation/paraglide-js/commit/c90030f): Escape `${` in compiled messages when the `$` and `{` come from separate text parts, or from text on either side of markup that is stripped in string output. Before, a pattern like `cost $` followed by `{1 + 1}` compiled to a live template literal substitution. - [`edc2576`](https://github.com/generaltranslation/paraglide-js/commit/edc2576): Don't reload Vite environments when the first virtual message output is published in `buildStart`. Vite buffered that `full-reload` and replayed it to the first browser that connected, so the first page opened after `vite dev` started reloaded itself. Replacing the virtual output and editing messages still reload. - [`99a4a91`](https://github.com/generaltranslation/paraglide-js/commit/99a4a91): Apply the configured `trailingSlash` policy to the catch-all fast path of `localizeUrl` and `deLocalizeUrl`. Previously `localizeHref("/", { locale: "en" })` returned `/en/` with `trailingSlash: "never"` because the fast path returned before normalization. - [`a5af446`](https://github.com/generaltranslation/paraglide-js/commit/a5af446): The README in the compiled output now recommends General Translation for translating messages, through the inlang CLI's machine translation (`npx @inlang/cli machine translate --no-browser`). - [`479e764`](https://github.com/generaltranslation/paraglide-js/commit/479e764): Exit `paraglide-js init` when a prompt is cancelled with Ctrl+C. Previously consola resolved a cancelled prompt with its default answer, so setup continued as if the default had been chosen. - [`9bd62b1`](https://github.com/generaltranslation/paraglide-js/commit/9bd62b1): `paraglide-js init` now double-quotes paths with spaces in the package.json scripts it writes (`build`, `check:i18n`, `machine-translate`), so they also run under npm's default Windows shell, cmd.exe, which doesn't treat single quotes as quotes. - [`bdb4f36`](https://github.com/generaltranslation/paraglide-js/commit/bdb4f36): License under MIT with copyright General Translation, Inc. The framework packages now include the `LICENSE` file in their npm package. - [`05a3df3`](https://github.com/generaltranslation/paraglide-js/commit/05a3df3): Use locale modules by default in Vite dev servers and Vitest to avoid one HTTP request per message in large catalogs. Keep virtual modules for Vite builds, preserve explicit layout overrides, and retain generated TypeScript declarations for the default layouts. - [`ecb7914`](https://github.com/generaltranslation/paraglide-js/commit/ecb7914): Keep the virtual-modules optimization when a message is read in a destructuring default value, such as `let { text = m.hello() } = $props()` in Svelte 5 server output. Before, any `m.key` below an `AssignmentPattern` made the file fall back to importing the whole message barrel. - [`6e69650`](https://github.com/generaltranslation/paraglide-js/commit/6e69650): Fix Vitest reusing stale cached transforms of rewritten message imports after `outputStructure` changes outside the Vite config file. The plugin now registers a Vitest cache key (`defineCacheKeyGenerator`) derived from the effective virtual output and its message ids. ### [`v3.2.2`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#322) ##### Patch Changes - [`4445e45`](https://github.com/generaltranslation/paraglide-js/commit/4445e45): Preserve Vite's SSR detection expression when resolving compiler defaults, while respecting explicit plugin and config overrides. Keep the generated `isServer` declaration typed as `boolean` for the Vite expression. ### [`v3.2.1`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#321) ##### Patch Changes - [`6024837`](https://github.com/generaltranslation/paraglide-js/commit/6024837): Normalize filesystem module IDs returned by virtual messages on Windows and resolve physical imports through Vite so its symlink settings are respected. This prevents duplicate runtime instances that caused SSR and prerendered messages to use the base locale instead of the request locale. Preserve Windows UNC network-share prefixes when normalizing configuration and watch paths. Handle trailing separators in directory containment checks so config edits reload correctly at UNC share roots, drive roots, and POSIX roots. ### [`v3.2.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#320) ##### Minor Changes - [`4045ec4`](https://github.com/generaltranslation/paraglide-js/commit/4045ec4): Add `lazyUrlPatternPolyfill: true` to load the URLPattern polyfill only when it is missing in generated runtimes with custom URL patterns or route strategies. This uses conditional top-level await and requires Vite 7+ or another ESM toolchain and runtime supporting top-level await. The option defaults to `false`, preserving the static polyfill import. Routing APIs remain synchronous. ### [`v3.1.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#310) ##### Minor Changes - [`4687696`](https://github.com/generaltranslation/paraglide-js/commit/4687696): Include shared bundle descriptions in generated JavaScript JSDoc and TypeScript declarations. Description edits refresh generated documentation, multiline guidance is escaped safely, and descriptions stay out of runtime message metadata and translated text. Description ingestion requires the coordinated inlang SDK 4.2 release and description-capable format plugins. Formats without native metadata use the SDK-managed project companion file. ### [`v3.0.0`](https://github.com/generaltranslation/paraglide-js/blob/HEAD/CHANGELOG.md#300) ##### Major Changes - [`f65ba59`](https://github.com/generaltranslation/paraglide-js/commit/f65ba59): Remove the `additionalFiles` compiler option in Paraglide JS 3. Custom files and overrides of generated files are no longer supported through this option. Existing JavaScript configurations using it fail with migration guidance instead of silently dropping those files. Remove `additionalFiles` from your compiler, bundler plugin, or `paraglide.config.*` options. Keep framework helpers and message re-export wrappers in your application source, outside Paraglide's generated output directory. Manage extra assets, metadata, and source maps through your own build tooling. Paraglide continues to generate declarations for its own output when `emitTsDeclarations` is enabled. Allow Paraglide JS 3 in the framework helper packages’ peer dependency ranges. The CLI emits declarations by default (use `--no-emit-ts-declarations` to disable them). Init explicitly enables declaration emission in generated Vite integrations, compile scripts, and its initial compilation, and no longer reads or changes `tsconfig.json` to enable `allowJs`. The programmatic compiler and bundler plugin option default remains `emitTsDeclarations: false`. Use the SDK catalog entry point directly, removing the older SDK database-loading fallback and compatibility detection. Remove the unused deprecated `NodeishFilesystem` type. The public `createParaglide()` API remains available. - [`05a3e17`](https://github.com/generaltranslation/paraglide-js/commit/05a3e17): Remove `experimentalMiddlewareLocaleSplitting` for Paraglide v3, including its compiler option, runtime message tracking, and middleware HTML script injection. Generated runtimes no longer export `trackMessageCall` or `experimentalMiddlewareLocaleSplitting`, and async local storage no longer tracks message calls. Per-locale builds are the recommended way to ship only the active locale's messages. Remove `experimentalMiddlewareLocaleSplitting` from your configuration and use `experimentalPerLocaleBuild: true` for supported Vite applications. Per-locale builds require full-document navigation when switching locales and a deployment that selects the matching locale output. See the [per-locale build guide](https://paraglidejs.com/compiling-messages#experimental-per-locale-builds) for framework and deployment constraints. - [`eb5dc1d`](https://github.com/generaltranslation/paraglide-js/commit/eb5dc1d): Add `outputStructure: "virtual-modules"` and make it the default for the Vite integration in development and production. Keep public runtime/message entry points on disk, combine message declarations, and serve individual message implementations virtually. Safe static message imports avoid loading the complete message barrel while preserving per-message tree shaking. This layout requires the Vite plugin. Select `outputStructure: "message-modules"` or `"locale-modules"` explicitly for physical message files, standalone Node scripts or grouped output. CLI and other bundler defaults remain unchanged. ##### Minor Changes - [`f09ced5`](https://github.com/generaltranslation/paraglide-js/commit/f09ced5): Require SDK 4.1.0 and use its stateful `createCatalogLoader()` for directory compilation. Reuse the loader through `previousCompilation`, apply complete reset/update batches, and replace the unreleased snapshot catalog integration. Existing `compileProject()`, `compileCatalog()` and offline plugin caches remain supported. Reuse unchanged generated output and hashes. With the default one-message-per-module layout, translation and input edits compile only changed bundles. Settings, plugin, key-set, option and shared-layout changes use the full emitter as needed; unchanged catalogs reuse output for all layouts. Serialize concurrent compiles and invalidate consumed loader state and disk hashes after publication failures so retries restore missing files. Invalidate Vite's transform cache before error-recovery reloads to serve fresh translations. Retain opt-in `messageModuleSize` grouping for `message-modules` output, including `--message-module-size` in the CLI. Groups preserve named exports, input types, metadata, documentation, and per-message tree shaking. The default remains one message per file; import grouped messages through `messages.js` because grouping changes direct generated module paths. - [`565b11b`](https://github.com/generaltranslation/paraglide-js/commit/565b11b): Generate `.d.ts` files directly when `emitTsDeclarations` is enabled, removing TypeScript compiler analysis and the optional TypeScript peer dependency. TypeScript is no longer required to generate declarations. On a synthetic project with 6,400 messages and three locales, declaration generation takes 23 ms for `message-modules` and 26 ms for `locale-modules`, compared with 2.22 s and 2.54 s through TypeScript 7 (about 99% less time). The TypeScript 5 path takes 3.48 s and 20.03 s, respectively. These are medians of three runs on Node.js 22 and measure declaration generation only, excluding project loading, JavaScript generation, and final output writes. Generated declarations preserve boolean literals and common `typeof` comparisons for `isServer`. Other custom expressions have type `any`, allowing bundler-specific expressions without analyzing JavaScript. - [`506efa1`](https://github.com/generaltranslation/paraglide-js/commit/506efa1): Add a bundler-independent `isDevelopment` compiler expression for runtime diagnostics. Vite uses its resolved development/production mode; other bundler plugins default from `NODE_ENV`. Standalone compilation can disable diagnostics with `isDevelopment: "false"` or `--is-development false`. Make locale-specialized override warnings development-only and allow unused cookie-pattern setup to be tree-shaken. Keep the shared `globalThis.__paraglide` runtime object initialized for backward compatibility and future runtime behavior. ##### Patch Changes - [`0d500bb`](https://github.com/generaltranslation/paraglide-js/commit/0d500bb): Read `window.location.href` in `getLocale()` only when a route strategy or the `url` strategy needs it. Every message call resolves the locale, and each read of `window.location.href` serializes the URL; `getLocale()` read it up to three times per call. - [`4bdad54`](https://github.com/generaltranslation/paraglide-js/commit/4bdad54): Give every message and local variable its own identifier in the generated code. Keys that map to the same module id, like `a.b` and `a_b`, no longer overwrite each other: the key that is that id keeps it, and the others get an escaped id such as `$a$2e$b`. Messages named `_index`, `eval` or `arguments`, a formatted message named `registry`, and local variables named `i`, `String`, `class` or `a-b` no longer break the output. In grouped output, ids are unique within a shard, and the declaration barrel exports a type name two shards share under each key's escaped name. The registry is imported as `__paraglideRegistry`. Keys that don't collide keep their file, export and type names. - [`9a44eb7`](https://github.com/generaltranslation/paraglide-js/commit/9a44eb7): With `outputStructure: "message-modules"` and one message per module, `messages/_index.d.ts` declares every message itself instead of re-exporting one declaration file per message, so TypeScript reads one declaration file for `messages.js`. The per-message declarations remain for direct imports. - [`b2db911`](https://github.com/generaltranslation/paraglide-js/commit/b2db911): Read existing output files concurrently when hashing the output directory. An unchanged start of the bundler plugins with physical output, and a CLI compile into an existing output directory, no longer read thousands of message modules one at a time. - [`dcac182`](https://github.com/generaltranslation/paraglide-js/commit/dcac182): Escape line breaks in the quoted string literals the compiler emits, such as formatter option values and `.local` literals. A literal containing a line break made the generated module fail to parse. - [`87d1360`](https://github.com/generaltranslation/paraglide-js/commit/87d1360): Allow message-body inlining in per-locale builds using `outputStructure: "message-modules"`, reducing generated client code while retaining locale selection, fallback behavior, and override warnings. - [`49ff68f`](https://github.com/generaltranslation/paraglide-js/commit/49ff68f): Look up locales in `toLocale()` by their lowercased form instead of lowercasing every configured locale on each call. Calls that resolve their locale through the runtime's strategies paid one `toLowerCase()` per configured locale before the active one. The configured locales are treated as immutable, as their readonly type states. - [`9436403`](https://github.com/generaltranslation/paraglide-js/commit/9436403): Grouped message modules (`messageModuleSize` above 1) no longer export their shared helper types. Every shard declared `__ParaglideOptions`, `__ParaglideMessage` and `__ParaglideOptionalMessage`, so `messages.js` exported them: a module that re-exported `messages.js` beside another export of those names failed with TS2308, and with two or more shards `messages/_index.js` (with `checkJs`) and `messages/_index.d.ts` (with `skipLibCheck: false`) failed because their `export *` exported the same names from every shard. The helpers are now declared once, in `messages/_shard_types.js` and `.d.ts`, which the barrel does not re-export, and each shard imports them type-only. - [`4737859`](https://github.com/generaltranslation/paraglide-js/commit/4737859): Write catalog and option strings into generated code so they keep their exact value. An input name or match key containing `*/` no longer ends the generated JSDoc. `localStorageKey`, `cookieName` and `cookieDomain` may contain quotes, backslashes, `$&` or text of the runtime template, like `<cookie-domain>`. The fallback of an untranslated key with an apostrophe no longer breaks `locale-modules` output. Markup options and attributes named `__proto__` are own properties of `.parts()` objects, and formatter options with a namespace or a dash, like `u:locale`, compile. - [`2b999e4`](https://github.com/generaltranslation/paraglide-js/commit/2b999e4): Declarations that hold many messages in one file (`messages.virtual.d.ts`, and `messages/_index.d.ts` and the per-locale files of `locale-modules`) now refer to the runtime's `MessageMetadata` and `MessagePart` types through private shared aliases instead of an `import("…")` type per message. TypeScript locates each `import()` type by walking the file from its first statement, so creating the program took time quadratic in the number of messages. - [`6f5ccc4`](https://github.com/generaltranslation/paraglide-js/commit/6f5ccc4): Read the locale of the default URL pattern from the URL that `extractLocaleFromUrl()` already parsed, instead of parsing it a second time. `localizeHref()` and `localizeUrl()` extract the locale of every link they localize. - [`7525f9c`](https://github.com/generaltranslation/paraglide-js/commit/7525f9c): Rewrite `const { key } = m` (and other object patterns that read the namespace whole) and fully static template-literal keys such as ``m[`key`]`` to direct virtual message imports. Before, both kept the whole message barrel: in development every message module loaded, and a production build that destructured `m` bundled the entire catalog. - [`7bcdae7`](https://github.com/generaltranslation/paraglide-js/commit/7bcdae7): Rewrite the `_unref(m).key` reads that compiled Vue templates use (production builds inline the template into `<script setup>`) to direct virtual message imports. Vue's `unref(x)` returns `x.value` only when `x.__v_isRef === true`; every export of the message namespace is a message function, so none can be `true`, `unref(m)` is `m`, and these reads are static. Before, a Vue component that used `m` in its template kept the whole message barrel, and the production build bundled every message. - [`e32ee1e`](https://github.com/generaltranslation/paraglide-js/commit/e32ee1e): Update every Vite environment when virtual messages change. A custom environment, such as a framework's runnable server environment, kept serving the previous translations after a catalog edit, because only the client and SSR module graphs were invalidated. Each environment's module graph is now invalidated and its hot channel notified, once. Vite 5, which has no environment API, keeps the previous behavior. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTguMCIsInVwZGF0ZWRJblZlciI6IjQ1LjExLjEiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIiwibGFiZWxzIjpbXX0=-->
Update dependency @inlang/paraglide-js to v3
All checks were successful
Build and Publish / build (push) Successful in 2m6s
203d5e7fe1
All checks were successful
Build and Publish / build (push) Successful in 2m6s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/inlang-paraglide-js-3.x:renovate/inlang-paraglide-js-3.x
git switch renovate/inlang-paraglide-js-3.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff renovate/inlang-paraglide-js-3.x
git switch renovate/inlang-paraglide-js-3.x
git rebase develop
git switch develop
git merge --ff-only renovate/inlang-paraglide-js-3.x
git switch renovate/inlang-paraglide-js-3.x
git rebase develop
git switch develop
git merge --no-ff renovate/inlang-paraglide-js-3.x
git switch develop
git merge --squash renovate/inlang-paraglide-js-3.x
git switch develop
git merge --ff-only renovate/inlang-paraglide-js-3.x
git switch develop
git merge renovate/inlang-paraglide-js-3.x
git push origin develop
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/bigfivenec!122
No description provided.