Skip to content

Ship source maps for Citry's browser JavaScript #153

Open

Description

@JuroOravec

The citry wheel ships its browser code as one bundle, _vue/runtime.js. It concatenates Vue's runtime, the fragments and events bridges, and Citry's own client code, which is stripped of comments and whitespace. The readable source files (client.js, vue.js, events.js, fragments.js) are no longer shipped separately, because nothing loads them and editing an installed copy would do nothing, which only confuses debugging.

That leaves no readable version in the browser. Add source maps so developer tools show and step through the original sources instead of the bundled, stripped code.

Scope

  • _vue/runtime.js: emit runtime.js.map from the build (packages/js/citry-client/build.mjs), with sourcesContent embedded so no separate source files need to ship, and a //# sourceMappingURL= comment the asset routes can serve.
  • The i18n Vue plugin (ext/i18n/client/vue-plugin.source.js) and any other shipped browser script.
  • Citry UI component assets: runtime.min.js / runtime.min.css are generated from runtime.source.* by packages/py/citry_ui/tools/build_assets.mjs; emit maps there too.

Things to decide

  • Serve maps always, or only in development settings? Maps expose readable source, which is already open source, but they add bytes to the wheel and a request when devtools is open.
  • How the asset routes serve .map files (content type, the same CORS rules as other Citry assets, integrity does not apply to maps).
  • Keep the build deterministic: the same input must produce byte-identical runtime.js and map, since runtime.js is committed and CI checks it is up to date.
  • Wheel size: the maps count against the verifier's MAX_WHEEL_BYTES limit.

Activity

  1. added
    next-sprint
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions