@reckona/mreact-router 0.0.183 → 0.0.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/render.js CHANGED
@@ -755,7 +755,7 @@ async function renderAppRequestInternal(options) {
755
755
  assetBaseUrl: options.assetBaseUrl,
756
756
  currentStyleSheets: clientStyleSheets,
757
757
  currentScript: clientRoute ? clientScript : undefined,
758
- currentNavigationScript: clientRoute ? undefined : navigationScript,
758
+ currentNavigationScript: navigationScript,
759
759
  routeScripts: options.clientScripts,
760
760
  })}${html}`, preparedActions.htmlReplacements), {
761
761
  headers: responseHeadersForMetadata(metadata, options.request, {
@@ -999,7 +999,7 @@ async function renderAppRequestInternal(options) {
999
999
  assetBaseUrl: options.assetBaseUrl,
1000
1000
  currentStyleSheets: clientStyleSheets,
1001
1001
  currentScript: clientRoute ? clientScript : undefined,
1002
- currentNavigationScript: clientRoute ? undefined : navigationScript,
1002
+ currentNavigationScript: navigationScript,
1003
1003
  routeScripts: options.clientScripts,
1004
1004
  })}${html}`, preparedActions.htmlReplacements), {
1005
1005
  headers: responseHeadersForMetadata(metadata, options.request),
@@ -1150,9 +1150,13 @@ function hasUrlScheme(value) {
1150
1150
  return true;
1151
1151
  }
1152
1152
  function navigationRuntimeScriptTag(script, assetBaseUrl) {
1153
- return script === undefined
1154
- ? ""
1155
- : `<script type="module" src="${escapeHtmlAttribute(assetPath(script, assetBaseUrl ?? "/_mreact/client/"))}"></script>`;
1153
+ if (script === undefined) {
1154
+ return "";
1155
+ }
1156
+ const json = JSON.stringify({
1157
+ script: assetPath(script, assetBaseUrl ?? "/_mreact/client/"),
1158
+ }).replaceAll("<", "\\u003c");
1159
+ return `<script type="application/json" id="mreact-navigation-runtime">${json}</script>`;
1156
1160
  }
1157
1161
  function routePrefetchManifestScript(routeScripts, assetBaseUrl) {
1158
1162
  if (routeScripts === undefined || routeScripts.size === 0) {