Skip to content

fix(deps): update dependency @inlang/paraglide-js to v3 - #171

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/inlang-paraglide-js-3.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/inlang-paraglide-js-3.x

Conversation

@renovate

@renovate renovate Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@inlang/paraglide-js (source) ^2.25.0 → ^3.0.0 age confidence

Release Notes

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

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: (in timezone Europe/Berlin)

  • 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 was generated by Mend Renovate. View the repository job log.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 242ff781-6c8e-4dca-a90b-5aa389589cd1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@renovate
renovate Bot force-pushed the renovate/inlang-paraglide-js-3.x branch 3 times, most recently from 0484268 to 5d0e9a9 Compare November 6, 2026 01:06
@patriksimms

Copy link
Copy Markdown
Owner

Not merging: this is a major upgrade with a red pipeline.

Both verify and production-image fail on the same cause:

  • verify: db:seed fails with Cannot find module 'virtual:paraglide/.../messages/_index.js', imported from src/paraglide/messages.js.
  • production-image: build:cleanup fails with Could not resolve: "virtual:paraglide/.../messages/_index.js".

Paraglide 3 changed the default output layout to serve message implementations virtually, which requires its Vite plugin. Scripts running outside Vite, and build:cleanup, cannot resolve those modules.

Likely fix, not yet tried: set outputStructure: "message-modules" in scripts/compile-messages.ts. The 3.0.0 notes name this option for standalone Node scripts. The other 3.0 breaking changes (such as the removed additionalFiles and experimentalMiddlewareLocaleSplitting options) still need checking against this repo.

@renovate
renovate Bot force-pushed the renovate/inlang-paraglide-js-3.x branch from 5d0e9a9 to 1588b6c Compare November 7, 2026 04:56
@patriksimms

Copy link
Copy Markdown
Owner

Not merging: this is a major upgrade (v2 → v3) with a breaking change that turns CI red.

Paraglide v3 compiles src/paraglide/messages.js to import from a Vite virtual module (virtual:paraglide/<hash>/messages/_index.js). Anything that loads messages outside Vite fails:

  • verify: bun run db:seed (scripts/seed.ts) → Cannot find module 'virtual:paraglide/.../messages/_index.js', so e2e never starts
  • production-image: bun run build:cleanup (scripts/build-cleanup.ts) → Could not resolve: "virtual:paraglide/..."

Upgrading needs a migration: either a v3 compile option that emits plain files for scripts/compile-messages.ts, or keep the Bun scripts from importing #/paraglide/*. Worth doing as a dedicated change together with the v3 migration guide.

Comment by Claude Code (claude-opus-5-5)

@renovate
renovate Bot force-pushed the renovate/inlang-paraglide-js-3.x branch from 1588b6c to 6c7efd4 Compare November 9, 2026 04:53
@patriksimms

Copy link
Copy Markdown
Owner

Not merging: @inlang/paraglide-js v3 is a major with a breaking output change.

v3 compiles src/paraglide/messages.js to import from virtual:paraglide/<hash>/messages/_index.js. That only resolves inside Vite, so everything that loads messages outside Vite breaks:

  • bun run build → build:cleanup: Could not resolve: "virtual:paraglide/.../messages/_index.js" (production image fails)
  • db:seed (e2e setup): Cannot find module 'virtual:paraglide/.../messages/_index.js'

Needs a deliberate migration (switch the compiler output to real files for non-Vite consumers, or move those scripts behind Vite) plus a test covering message lookup from the seed/build path. Leaving open for that.

🤖 Generated with Claude Code

@renovate
renovate Bot force-pushed the renovate/inlang-paraglide-js-3.x branch from 6c7efd4 to 882c6f5 Compare November 11, 2026 01:02
@patriksimms

Copy link
Copy Markdown
Owner

Not merging: this is a major upgrade (v2 → v3) and it breaks the build in this repo.

What fails

  • build:cleanup (production image) and db:seed (e2e) crash with Cannot find module 'virtual:paraglide/<hash>/messages/_index.js' from src/paraglide/messages.js.
  • In v3 the Vite plugin emits code that imports Vite virtual modules. Scripts run directly with Bun (scripts/build-cleanup.ts, scripts/seed.ts) import the generated messages outside Vite and can't resolve them.

Likely migration

  • Compile messages to real files for non-Vite consumers (e.g. run the paraglide CLI compile before build:cleanup / db:seed), or stop importing src/paraglide from those Bun scripts.
  • Check v3 removals: additionalFiles and experimentalMiddlewareLocaleSplitting (not used in vite.config.ts as far as I can see).

Needs a deliberate migration PR rather than a renovate fix-up.


🤖 Generated with Claude Code (Claude Opus 5.5)

@renovate
renovate Bot force-pushed the renovate/inlang-paraglide-js-3.x branch from 882c6f5 to 35cbf9a Compare November 18, 2026 01:33
@patriksimms

Copy link
Copy Markdown
Owner

Not merging: major upgrade with a breaking default change that affects us.

verify and production-image fail when db:seed runs server code outside Vite:

error: Cannot find module 'virtual:paraglide/<hash>/messages/_index.js' from 'src/paraglide/messages.js'

Paraglide 3 makes outputStructure: "virtual-modules" the default for the Vite plugin, and that layout only resolves inside Vite. Our seed script and server modules (auth-policy.ts, export-service.ts, decorative-asset-service.ts) import #/paraglide/messages.js from plain Bun, so they break. Likely fix: set outputStructure: "message-modules" in the Vite plugin config (and scripts/compile-messages.ts), then rerun verify. Also check the removed additionalFiles / experimentalMiddlewareLocaleSplitting options are not in use.

Checked by Claude Code (claude-opus-5-5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant