This release adds the server features that 1mg's mweb app ran on its own branch, and fixes preServerInit being skipped for some apps since 1.1.0. There are no breaking changes to the public API. Three behaviour changes are listed below.
Added
- CSP nonce. With
CSP_NONCE_ENABLE: trueinconfig/config.json, every script and modulepreload link Catalyst renders carries a per-request nonce. Setres.locals.cspNoncein a middleware to use your own; a value outside the base64 alphabet is replaced with a generated one. Styles are not nonced. - OpenTelemetry error sampling.
Otel.init({ errorSampling: { ENABLED: true } })keeps unsampled traces in memory until the request ends and exports the ones that failed. While it is on, the server logs a memory heartbeat. See the Observability guide for the options. OFFLINE_SNAPSHOTS_ENABLE: falseturns off Catalyst's service worker and offline manifest, for apps that ship their own worker.App.serverSideFunctionreceivesrunInParallel(...promises). Work passed to it runs alongside the route'sserverFetcher, and both finish before the store is serialized.- Native:
WEBVIEW_CONFIG.location.enabledadds the Android location permissions and the WebView geolocation prompt, andNSLocationWhenInUseUsageDescriptionon iOS (location.usageDescriptionsets the text).
Fixes
preServerInitruns again for apps whoseserver/index.jsimports an alias from_moduleAliases. Since 1.1.0 the module loader was registered afterserver/index.jswas imported, so the import failed and the hook was skipped without a message.MetaTagis the only owner of the tags fromsetMetaData, apart from the title. The server no longer renders them twice, and the previous page's description and canonical no longer stay after a client navigation.- A failed
catalyst buildprints the bundler's own error (missing package, missing export, Sass error and so on) instead of onlyBUNDLE-000and stack frames. - SSR builds resolve the
module-synccondition, which fixes two copies of react-router being loaded on Node 22.
Behaviour changes
- A
server/index.jsthat exists but fails to import now stops startup with the import error. It used to be skipped. <script type="application/ld+json">fromsetMetaDatarenders in the page body, whereMetaTagsits, instead of in<head>.- Route-data cache keys are HTML-escaped (
&becomes&). Server and client compute them the same way, so this matters only to code that builds a key by hand.