@bleedingdev/modern-js-runtime 3.2.0-ultramodern.103 → 3.2.0-ultramodern.104

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.
Files changed (33) hide show
  1. package/dist/cjs/boundary-debugger/index.js +6 -6
  2. package/dist/cjs/core/server/federatedCss.js +2 -2
  3. package/dist/cjs/core/server/scriptOrder.js +2 -2
  4. package/dist/cjs/core/server/stream/beforeTemplate.js +1 -1
  5. package/dist/cjs/core/server/stream/beforeTemplate.worker.js +1 -1
  6. package/dist/cjs/exports/head.js +9 -5
  7. package/dist/cjs/exports/loadable.js +12 -7
  8. package/dist/cjs/router/runtime/PrefetchLink.js +3 -2
  9. package/dist/cjs/router/runtime/tanstack/outlet.js +1 -1
  10. package/dist/cjs/router/runtime/tanstack/plugin.js +33 -36
  11. package/dist/esm/boundary-debugger/index.mjs +6 -6
  12. package/dist/esm/core/server/federatedCss.mjs +2 -2
  13. package/dist/esm/core/server/scriptOrder.mjs +2 -2
  14. package/dist/esm/core/server/stream/beforeTemplate.mjs +1 -1
  15. package/dist/esm/core/server/stream/beforeTemplate.worker.mjs +1 -1
  16. package/dist/esm/exports/head.mjs +9 -5
  17. package/dist/esm/exports/loadable.mjs +12 -6
  18. package/dist/esm/router/runtime/PrefetchLink.mjs +3 -2
  19. package/dist/esm/router/runtime/tanstack/outlet.mjs +1 -1
  20. package/dist/esm/router/runtime/tanstack/plugin.mjs +33 -36
  21. package/dist/esm-node/boundary-debugger/index.mjs +6 -6
  22. package/dist/esm-node/core/server/federatedCss.mjs +2 -2
  23. package/dist/esm-node/core/server/scriptOrder.mjs +2 -2
  24. package/dist/esm-node/core/server/stream/beforeTemplate.mjs +1 -1
  25. package/dist/esm-node/core/server/stream/beforeTemplate.worker.mjs +1 -1
  26. package/dist/esm-node/exports/head.mjs +9 -5
  27. package/dist/esm-node/exports/loadable.mjs +12 -6
  28. package/dist/esm-node/router/runtime/PrefetchLink.mjs +3 -2
  29. package/dist/esm-node/router/runtime/tanstack/outlet.mjs +1 -1
  30. package/dist/esm-node/router/runtime/tanstack/plugin.mjs +33 -36
  31. package/dist/types/exports/head.d.ts +4 -4
  32. package/dist/types/exports/loadable.d.ts +1 -1
  33. package/package.json +8 -8
@@ -83,7 +83,7 @@ const readQueryEnabledOverride = ()=>{
83
83
  const detectLanguage = ()=>{
84
84
  if ("u" < typeof document) return 'en';
85
85
  const htmlLanguage = document.documentElement.lang;
86
- if (htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
86
+ if ('' !== htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
87
87
  if ("u" < typeof window) return 'en';
88
88
  return window.location.pathname.split('/').filter(Boolean)[0] || 'en';
89
89
  };
@@ -102,7 +102,7 @@ const getBoundaryId = (element)=>element.dataset.modernBoundaryId ?? element.dat
102
102
  const collectBoundaryElements = (legacySelector)=>{
103
103
  const elements = new Set();
104
104
  for (const element of document.querySelectorAll(boundarySelector))elements.add(element);
105
- if (!legacySelector) return Array.from(elements);
105
+ if (void 0 === legacySelector || '' === legacySelector) return Array.from(elements);
106
106
  try {
107
107
  for (const element of document.querySelectorAll(legacySelector))elements.add(element);
108
108
  } catch {}
@@ -146,7 +146,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
146
146
  const seenBoxes = new Set();
147
147
  const nextBoxes = collectBoundaryElements(legacySelector).map((element)=>{
148
148
  const boundaryId = getBoundaryId(element);
149
- if (!boundaryId) return;
149
+ if (void 0 === boundaryId || '' === boundaryId) return;
150
150
  const rect = element.getBoundingClientRect();
151
151
  if (rect.width <= 0 || rect.height <= 0) return;
152
152
  const rectKey = formatRectKey(rect);
@@ -157,7 +157,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
157
157
  const color = boundary?.color ?? palette[hashBoundaryId(boundaryId) % palette.length];
158
158
  const label = boundary?.label ?? boundary?.appId ?? boundaryId;
159
159
  const expose = element.dataset.modernMfExpose;
160
- const detail = expose && expose !== label && expose !== boundaryId ? expose : void 0;
160
+ const detail = void 0 !== expose && '' !== expose && expose !== label && expose !== boundaryId ? expose : void 0;
161
161
  const box = {
162
162
  color,
163
163
  height: rect.height,
@@ -167,7 +167,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
167
167
  top: rect.top,
168
168
  width: rect.width
169
169
  };
170
- if (detail) box.detail = detail;
170
+ if (void 0 !== detail) box.detail = detail;
171
171
  return box;
172
172
  }).filter((box)=>void 0 !== box);
173
173
  setBoxes(nextBoxes);
@@ -260,7 +260,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
260
260
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
261
261
  children: box.label
262
262
  }),
263
- box.detail ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
263
+ void 0 !== box.detail && '' !== box.detail ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
264
264
  style: {
265
265
  font: '700 10px/1.1 system-ui, sans-serif',
266
266
  opacity: 0.82,
@@ -32,11 +32,11 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  });
33
33
  const external_utils_js_namespaceObject = require("./utils.js");
34
34
  const createFederatedCssLinks = (assets, options)=>{
35
- if (!assets?.length) return '';
35
+ if (void 0 === assets || 0 === assets.length) return '';
36
36
  const seen = new Set(options.existingAssets || []);
37
37
  const attributes = (0, external_utils_js_namespaceObject.attributesToString)(options.attributes || {});
38
38
  const links = [];
39
- for (const asset of assets)if (!(!asset || seen.has(asset) || options.template.includes(asset))) {
39
+ for (const asset of assets)if (!('' === asset || seen.has(asset) || options.template.includes(asset))) {
40
40
  seen.add(asset);
41
41
  links.push(`<link${attributes} href="${asset}" rel="stylesheet" />`);
42
42
  }
@@ -45,10 +45,10 @@ function isEntryScript(src, entryName, asyncEntry) {
45
45
  return basename === `${prefix}.js` || basename.startsWith(`${prefix}.`) || basename.startsWith(`${prefix}-`);
46
46
  }
47
47
  function injectBeforeHydrationEntryScript(template, scripts, entryName = 'index') {
48
- if (!scripts) return template;
48
+ if ('' === scripts) return template;
49
49
  const scriptTags = getScriptTags(template);
50
50
  const target = scriptTags.find((match)=>isEntryScript(match.src, entryName, false)) ?? scriptTags.find((match)=>isEntryScript(match.src, entryName, true));
51
- if (!target) return template;
51
+ if (void 0 === target) return template;
52
52
  return `${template.slice(0, target.index)}${scripts}${template.slice(target.index)}`;
53
53
  }
54
54
  __webpack_require__.d(__webpack_exports__, {
@@ -77,7 +77,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
77
77
  if (!index) return;
78
78
  const routeId = match.route.id;
79
79
  if (routeId) return routeAssets[routeId];
80
- }).filter(Boolean) ?? [];
80
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
81
81
  }
82
82
  const asyncEntry = routeAssets[`async-${entryName}`];
83
83
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -71,7 +71,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
71
71
  if (!index) return;
72
72
  const routeId = match.route.id;
73
73
  if (routeId) return routeAssets[routeId];
74
- }).filter(Boolean) ?? [];
74
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
75
75
  }
76
76
  const asyncEntry = routeAssets[`async-${entryName}`];
77
77
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -85,7 +85,7 @@ const createAttributeDatum = (attributes)=>({
85
85
  const createTitleDatum = (title, attributes)=>({
86
86
  toComponent: ()=>[],
87
87
  toString: ()=>{
88
- if (!title) return '';
88
+ if (void 0 === title || '' === title) return '';
89
89
  const attrs = attributesToString(attributes, true);
90
90
  return `<title ${attrs}>${escapeHtml(title)}</title>`;
91
91
  }
@@ -102,6 +102,10 @@ const createEmptyHelmetState = ()=>({
102
102
  style: createDatum('style', []),
103
103
  title: createTitleDatum(void 0, {})
104
104
  });
105
+ const normalizeHelmetTitle = (title)=>{
106
+ if ('string' == typeof title) return title;
107
+ if (Array.isArray(title)) return title.map((part)=>String(part)).join('');
108
+ };
105
109
  const mergeAttributes = (current, next)=>({
106
110
  ...current,
107
111
  ...next ?? {}
@@ -131,7 +135,7 @@ const collectHelmetProps = (current, props)=>{
131
135
  const baseState = current ?? createEmptyHelmetState();
132
136
  const draft = {
133
137
  base: [
134
- ...props.base ? [
138
+ ...void 0 !== props.base ? [
135
139
  props.base
136
140
  ] : []
137
141
  ],
@@ -152,11 +156,11 @@ const collectHelmetProps = (current, props)=>{
152
156
  style: [
153
157
  ...props.style ?? []
154
158
  ],
155
- title: 'string' == typeof props.title ? props.title : Array.isArray(props.title) ? props.title.join('') : void 0,
159
+ title: normalizeHelmetTitle(props.title),
156
160
  titleAttributes: props.titleAttributes ?? {}
157
161
  };
158
162
  collectChildren(props.children, draft);
159
- const title = draft.title && props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
163
+ const title = void 0 !== draft.title && '' !== draft.title && void 0 !== props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
160
164
  return {
161
165
  base: createDatum('base', [
162
166
  ...baseState.__baseTags ?? [],
@@ -218,7 +222,7 @@ const collectHelmetProps = (current, props)=>{
218
222
  };
219
223
  const Helmet = (props)=>{
220
224
  const runtimeContext = external_react_default().useContext(index_js_namespaceObject.InternalRuntimeContext);
221
- if (runtimeContext && !runtimeContext.isBrowser) {
225
+ if (null !== runtimeContext && false === runtimeContext.isBrowser) {
222
226
  runtimeContext._helmetContext ??= {};
223
227
  runtimeContext._helmetContext.helmet = collectHelmetProps(runtimeContext._helmetContext.helmet ?? void 0, props);
224
228
  return null;
@@ -52,7 +52,6 @@ var __webpack_exports__ = {};
52
52
  (()=>{
53
53
  __webpack_require__.r(__webpack_exports__);
54
54
  var _loadable_component__rspack_import_0 = __webpack_require__("@loadable/component");
55
- var _loadable_component__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_loadable_component__rspack_import_0);
56
55
  var __rspack_reexport = {};
57
56
  for(const __rspack_import_key in _loadable_component__rspack_import_0)if ([
58
57
  "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
@@ -61,22 +60,28 @@ var __webpack_exports__ = {};
61
60
  "lazy"
62
61
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_loadable_component__rspack_import_0[__rspack_import_key];
63
62
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
63
+ function asLoadableNamespace(value) {
64
+ return 'object' == typeof value && null !== value ? value : {};
65
+ }
64
66
  function resolveLoadable(module) {
65
- const namespace = module;
66
- const defaultExport = namespace.default;
67
+ const namespace = asLoadableNamespace(module);
68
+ const defaultExport = asLoadableNamespace(namespace.default);
67
69
  const candidates = [
68
70
  module,
69
71
  namespace.default,
70
72
  defaultExport?.default
71
73
  ];
72
74
  const loadable = candidates.find((candidate)=>'function' == typeof candidate);
73
- if (!loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
75
+ if ('function' != typeof loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
74
76
  return loadable;
75
77
  }
76
78
  const loadable = resolveLoadable(_loadable_component__rspack_import_0);
77
- const lazy = _loadable_component__rspack_import_0.lazy ?? _loadable_component__rspack_import_0_default()?.lazy ?? loadable.lazy;
78
- const loadableReady = _loadable_component__rspack_import_0.loadableReady ?? _loadable_component__rspack_import_0_default()?.loadableReady ?? loadable.loadableReady;
79
- const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _loadable_component__rspack_import_0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? _loadable_component__rspack_import_0_default()?.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadable.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
79
+ const loadableNamespace = asLoadableNamespace(_loadable_component__rspack_import_0);
80
+ const loadableDefaultNamespace = asLoadableNamespace(loadableNamespace.default);
81
+ const callableLoadableNamespace = asLoadableNamespace(loadable);
82
+ const lazy = loadableNamespace.lazy ?? loadableDefaultNamespace.lazy ?? callableLoadableNamespace.lazy;
83
+ const loadableReady = loadableNamespace.loadableReady ?? loadableDefaultNamespace.loadableReady ?? callableLoadableNamespace.loadableReady;
84
+ const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = loadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadableDefaultNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? callableLoadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
80
85
  const __rspack_default_export = loadable;
81
86
  __webpack_require__.d(__webpack_exports__, {}, {
82
87
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
@@ -66,6 +66,7 @@ const SLOW_EFFECTIVE_TYPES = new Set([
66
66
  const warmupCache = new Map();
67
67
  const warmupQueue = [];
68
68
  let activeWarmups = 0;
69
+ const getWarmupTimestamp = ()=>performance.now();
69
70
  const getConnection = ()=>{
70
71
  const nav = globalThis.navigator;
71
72
  return nav?.connection || nav?.mozConnection || nav?.webkitConnection;
@@ -76,7 +77,7 @@ const shouldWarmupOnCurrentNetwork = ()=>{
76
77
  if ('string' == typeof connection?.effectiveType && SLOW_EFFECTIVE_TYPES.has(connection.effectiveType)) return false;
77
78
  return true;
78
79
  };
79
- const pruneWarmupCache = (now = Date.now())=>{
80
+ const pruneWarmupCache = (now = getWarmupTimestamp())=>{
80
81
  for (const [key, timestamp] of warmupCache)if (now - timestamp > WARMUP_TTL) warmupCache.delete(key);
81
82
  };
82
83
  const runNextWarmup = ()=>{
@@ -97,7 +98,7 @@ const scheduleWarmup = (key, run)=>{
97
98
  if (!shouldWarmupOnCurrentNetwork()) return ()=>{};
98
99
  pruneWarmupCache();
99
100
  if (warmupCache.has(key)) return ()=>{};
100
- warmupCache.set(key, Date.now());
101
+ warmupCache.set(key, getWarmupTimestamp());
101
102
  const task = {
102
103
  key,
103
104
  run,
@@ -38,7 +38,7 @@ const Outlet = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function()
38
38
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.Outlet, {});
39
39
  });
40
40
  function withModernRouteMatchContext(component, _routeId) {
41
- if (!component) return component;
41
+ if (null == component) return component;
42
42
  const Component = component;
43
43
  const WrappedRouteComponent = (props)=>/*#__PURE__*/ (0, external_react_namespaceObject.createElement)(Component, props);
44
44
  const preloadable = component;
@@ -93,49 +93,46 @@ function getCachedRouteModule(routeId) {
93
93
  if ("u" < typeof window) return;
94
94
  return window[routeModulesKey]?.[routeId];
95
95
  }
96
- async function preloadHydratedRouteComponents(router) {
96
+ function preloadHydratedRouteComponents(router) {
97
97
  const preloadableRouter = router;
98
98
  const routesById = preloadableRouter.routesById || {};
99
99
  const matches = preloadableRouter.stores.matches.get();
100
- await Promise.all(matches.map((match)=>{
101
- if (!match.routeId) return;
100
+ return Promise.all(matches.map((match)=>{
101
+ if (void 0 === match.routeId || '' === match.routeId) return;
102
102
  const route = routesById[match.routeId];
103
103
  const component = route?.options?.component;
104
104
  const preload = component?.load || component?.preload;
105
105
  if ('function' != typeof preload) return;
106
106
  return Promise.resolve(preload.call(component)).then((routeModule)=>{
107
107
  const modernRouteId = route?.options?.staticData?.modernRouteId;
108
- const resolvedComponent = pickRouteModuleComponent(modernRouteId && getCachedRouteModule(modernRouteId) || routeModule);
109
- if (resolvedComponent && modernRouteId) route.options.component = (0, external_outlet_js_namespaceObject.withModernRouteMatchContext)(resolvedComponent, modernRouteId);
108
+ const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
109
+ const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
110
+ if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = (0, external_outlet_js_namespaceObject.withModernRouteMatchContext)(resolvedComponent, modernRouteId);
110
111
  });
111
- }));
112
+ })).then(()=>void 0);
112
113
  }
113
114
  function getTanstackSsrHydrationRecord(router) {
114
- let hydrationRecord = routerHydrationRecords.get(router);
115
- if (!hydrationRecord) {
116
- hydrationRecord = {
117
- promise: Promise.resolve(),
118
- status: 'pending'
119
- };
120
- routerHydrationRecords.set(router, hydrationRecord);
121
- try {
122
- hydrationRecord.promise = (0, client_namespaceObject.hydrate)(router).then(async (value)=>{
123
- await preloadHydratedRouteComponents(router);
124
- return value;
125
- }).then((value)=>{
126
- hydrationRecord.status = 'fulfilled';
127
- return value;
128
- }, (error)=>{
129
- hydrationRecord.status = 'rejected';
130
- hydrationRecord.error = error;
131
- throw error;
132
- });
133
- } catch (error) {
115
+ const existingHydrationRecord = routerHydrationRecords.get(router);
116
+ if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
117
+ const hydrationRecord = {
118
+ promise: Promise.resolve(),
119
+ status: 'pending'
120
+ };
121
+ routerHydrationRecords.set(router, hydrationRecord);
122
+ try {
123
+ hydrationRecord.promise = (0, client_namespaceObject.hydrate)(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
124
+ hydrationRecord.status = 'fulfilled';
125
+ return value;
126
+ }, (error)=>{
134
127
  hydrationRecord.status = 'rejected';
135
128
  hydrationRecord.error = error;
136
- hydrationRecord.promise = Promise.reject(error);
137
- hydrationRecord.promise.catch(()=>{});
138
- }
129
+ throw error;
130
+ });
131
+ } catch (error) {
132
+ hydrationRecord.status = 'rejected';
133
+ hydrationRecord.error = error;
134
+ hydrationRecord.promise = Promise.reject(error);
135
+ hydrationRecord.promise.catch(()=>{});
139
136
  }
140
137
  return hydrationRecord;
141
138
  }
@@ -256,13 +253,13 @@ const tanstackRouterPlugin = (userConfig = {})=>({
256
253
  });
257
254
  return cachedRouter;
258
255
  };
259
- api.onBeforeRender(async (context)=>{
256
+ api.onBeforeRender((context)=>{
260
257
  const mergedConfig = getMergedConfig();
261
- if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
258
+ if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
262
259
  const { ssrContext } = context;
263
260
  const currentPathname = (0, url_namespaceObject.normalizePathname)(window.location.pathname);
264
- const initialPathname = ssrContext?.request?.pathname && (0, url_namespaceObject.normalizePathname)(ssrContext.request.pathname);
265
- if (initialPathname && initialPathname !== currentPathname) {
261
+ const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? (0, url_namespaceObject.normalizePathname)(ssrContext.request.pathname) : void 0;
262
+ if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
266
263
  const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
267
264
  console.error(errorMsg);
268
265
  window.location.reload();
@@ -276,14 +273,14 @@ const tanstackRouterPlugin = (userConfig = {})=>({
276
273
  useRouter: react_router_namespaceObject.useRouter
277
274
  };
278
275
  const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
279
- if (hasSSRBootstrap && getRouteObjects().length) {
276
+ if (hasSSRBootstrap && getRouteObjects().length > 0) {
280
277
  const runtimeContext = context;
281
278
  const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
282
- if (router) await getTanstackSsrHydrationPromise(router);
279
+ if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
283
280
  }
284
281
  });
285
282
  api.wrapRoot((App)=>{
286
- if (!getRouteObjects().length) return App;
283
+ if (0 === getRouteObjects().length) return App;
287
284
  const RouterWrapper = ()=>{
288
285
  const runtimeContext = (0, external_react_namespaceObject.useContext)(index_js_namespaceObject.InternalRuntimeContext);
289
286
  const _basename = getClientBasename(runtimeContext);
@@ -50,7 +50,7 @@ const readQueryEnabledOverride = ()=>{
50
50
  const detectLanguage = ()=>{
51
51
  if ("u" < typeof document) return 'en';
52
52
  const htmlLanguage = document.documentElement.lang;
53
- if (htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
53
+ if ('' !== htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
54
54
  if ("u" < typeof window) return 'en';
55
55
  return window.location.pathname.split('/').filter(Boolean)[0] || 'en';
56
56
  };
@@ -69,7 +69,7 @@ const getBoundaryId = (element)=>element.dataset.modernBoundaryId ?? element.dat
69
69
  const collectBoundaryElements = (legacySelector)=>{
70
70
  const elements = new Set();
71
71
  for (const element of document.querySelectorAll(boundarySelector))elements.add(element);
72
- if (!legacySelector) return Array.from(elements);
72
+ if (void 0 === legacySelector || '' === legacySelector) return Array.from(elements);
73
73
  try {
74
74
  for (const element of document.querySelectorAll(legacySelector))elements.add(element);
75
75
  } catch {}
@@ -113,7 +113,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
113
113
  const seenBoxes = new Set();
114
114
  const nextBoxes = collectBoundaryElements(legacySelector).map((element)=>{
115
115
  const boundaryId = getBoundaryId(element);
116
- if (!boundaryId) return;
116
+ if (void 0 === boundaryId || '' === boundaryId) return;
117
117
  const rect = element.getBoundingClientRect();
118
118
  if (rect.width <= 0 || rect.height <= 0) return;
119
119
  const rectKey = formatRectKey(rect);
@@ -124,7 +124,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
124
124
  const color = boundary?.color ?? palette[hashBoundaryId(boundaryId) % palette.length];
125
125
  const label = boundary?.label ?? boundary?.appId ?? boundaryId;
126
126
  const expose = element.dataset.modernMfExpose;
127
- const detail = expose && expose !== label && expose !== boundaryId ? expose : void 0;
127
+ const detail = void 0 !== expose && '' !== expose && expose !== label && expose !== boundaryId ? expose : void 0;
128
128
  const box = {
129
129
  color,
130
130
  height: rect.height,
@@ -134,7 +134,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
134
134
  top: rect.top,
135
135
  width: rect.width
136
136
  };
137
- if (detail) box.detail = detail;
137
+ if (void 0 !== detail) box.detail = detail;
138
138
  return box;
139
139
  }).filter((box)=>void 0 !== box);
140
140
  setBoxes(nextBoxes);
@@ -227,7 +227,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
227
227
  /*#__PURE__*/ jsx("span", {
228
228
  children: box.label
229
229
  }),
230
- box.detail ? /*#__PURE__*/ jsx("span", {
230
+ void 0 !== box.detail && '' !== box.detail ? /*#__PURE__*/ jsx("span", {
231
231
  style: {
232
232
  font: '700 10px/1.1 system-ui, sans-serif',
233
233
  opacity: 0.82,
@@ -1,10 +1,10 @@
1
1
  import { attributesToString } from "./utils.mjs";
2
2
  const createFederatedCssLinks = (assets, options)=>{
3
- if (!assets?.length) return '';
3
+ if (void 0 === assets || 0 === assets.length) return '';
4
4
  const seen = new Set(options.existingAssets || []);
5
5
  const attributes = attributesToString(options.attributes || {});
6
6
  const links = [];
7
- for (const asset of assets)if (!(!asset || seen.has(asset) || options.template.includes(asset))) {
7
+ for (const asset of assets)if (!('' === asset || seen.has(asset) || options.template.includes(asset))) {
8
8
  seen.add(asset);
9
9
  links.push(`<link${attributes} href="${asset}" rel="stylesheet" />`);
10
10
  }
@@ -16,10 +16,10 @@ function isEntryScript(src, entryName, asyncEntry) {
16
16
  return basename === `${prefix}.js` || basename.startsWith(`${prefix}.`) || basename.startsWith(`${prefix}-`);
17
17
  }
18
18
  function injectBeforeHydrationEntryScript(template, scripts, entryName = 'index') {
19
- if (!scripts) return template;
19
+ if ('' === scripts) return template;
20
20
  const scriptTags = getScriptTags(template);
21
21
  const target = scriptTags.find((match)=>isEntryScript(match.src, entryName, false)) ?? scriptTags.find((match)=>isEntryScript(match.src, entryName, true));
22
- if (!target) return template;
22
+ if (void 0 === target) return template;
23
23
  return `${template.slice(0, target.index)}${scripts}${template.slice(target.index)}`;
24
24
  }
25
25
  export { injectBeforeHydrationEntryScript };
@@ -45,7 +45,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
45
45
  if (!index) return;
46
46
  const routeId = match.route.id;
47
47
  if (routeId) return routeAssets[routeId];
48
- }).filter(Boolean) ?? [];
48
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
49
49
  }
50
50
  const asyncEntry = routeAssets[`async-${entryName}`];
51
51
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -39,7 +39,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
39
39
  if (!index) return;
40
40
  const routeId = match.route.id;
41
41
  if (routeId) return routeAssets[routeId];
42
- }).filter(Boolean) ?? [];
42
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
43
43
  }
44
44
  const asyncEntry = routeAssets[`async-${entryName}`];
45
45
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -40,7 +40,7 @@ const createAttributeDatum = (attributes)=>({
40
40
  const createTitleDatum = (title, attributes)=>({
41
41
  toComponent: ()=>[],
42
42
  toString: ()=>{
43
- if (!title) return '';
43
+ if (void 0 === title || '' === title) return '';
44
44
  const attrs = attributesToString(attributes, true);
45
45
  return `<title ${attrs}>${escapeHtml(title)}</title>`;
46
46
  }
@@ -57,6 +57,10 @@ const createEmptyHelmetState = ()=>({
57
57
  style: createDatum('style', []),
58
58
  title: createTitleDatum(void 0, {})
59
59
  });
60
+ const normalizeHelmetTitle = (title)=>{
61
+ if ('string' == typeof title) return title;
62
+ if (Array.isArray(title)) return title.map((part)=>String(part)).join('');
63
+ };
60
64
  const mergeAttributes = (current, next)=>({
61
65
  ...current,
62
66
  ...next ?? {}
@@ -86,7 +90,7 @@ const collectHelmetProps = (current, props)=>{
86
90
  const baseState = current ?? createEmptyHelmetState();
87
91
  const draft = {
88
92
  base: [
89
- ...props.base ? [
93
+ ...void 0 !== props.base ? [
90
94
  props.base
91
95
  ] : []
92
96
  ],
@@ -107,11 +111,11 @@ const collectHelmetProps = (current, props)=>{
107
111
  style: [
108
112
  ...props.style ?? []
109
113
  ],
110
- title: 'string' == typeof props.title ? props.title : Array.isArray(props.title) ? props.title.join('') : void 0,
114
+ title: normalizeHelmetTitle(props.title),
111
115
  titleAttributes: props.titleAttributes ?? {}
112
116
  };
113
117
  collectChildren(props.children, draft);
114
- const title = draft.title && props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
118
+ const title = void 0 !== draft.title && '' !== draft.title && void 0 !== props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
115
119
  return {
116
120
  base: createDatum('base', [
117
121
  ...baseState.__baseTags ?? [],
@@ -173,7 +177,7 @@ const collectHelmetProps = (current, props)=>{
173
177
  };
174
178
  const head_Helmet = (props)=>{
175
179
  const runtimeContext = react.useContext(InternalRuntimeContext);
176
- if (runtimeContext && !runtimeContext.isBrowser) {
180
+ if (null !== runtimeContext && false === runtimeContext.isBrowser) {
177
181
  runtimeContext._helmetContext ??= {};
178
182
  runtimeContext._helmetContext.helmet = collectHelmetProps(runtimeContext._helmetContext.helmet ?? void 0, props);
179
183
  return null;
@@ -1,21 +1,27 @@
1
1
  import * as __rspack_external__loadable_component_0aaae075 from "@loadable/component";
2
2
  export * from "@loadable/component";
3
+ function asLoadableNamespace(value) {
4
+ return 'object' == typeof value && null !== value ? value : {};
5
+ }
3
6
  function resolveLoadable(module) {
4
- const namespace = module;
5
- const defaultExport = namespace.default;
7
+ const namespace = asLoadableNamespace(module);
8
+ const defaultExport = asLoadableNamespace(namespace.default);
6
9
  const candidates = [
7
10
  module,
8
11
  namespace.default,
9
12
  defaultExport?.default
10
13
  ];
11
14
  const loadable = candidates.find((candidate)=>'function' == typeof candidate);
12
- if (!loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
15
+ if ('function' != typeof loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
13
16
  return loadable;
14
17
  }
15
18
  const loadable_loadable = resolveLoadable(__rspack_external__loadable_component_0aaae075);
16
- const lazy = __rspack_external__loadable_component_0aaae075.lazy ?? __rspack_external__loadable_component_0aaae075["default"]?.lazy ?? loadable_loadable.lazy;
17
- const loadableReady = __rspack_external__loadable_component_0aaae075.loadableReady ?? __rspack_external__loadable_component_0aaae075["default"]?.loadableReady ?? loadable_loadable.loadableReady;
18
- const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = __rspack_external__loadable_component_0aaae075.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? __rspack_external__loadable_component_0aaae075["default"]?.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadable_loadable.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
19
+ const loadableNamespace = asLoadableNamespace(__rspack_external__loadable_component_0aaae075);
20
+ const loadableDefaultNamespace = asLoadableNamespace(loadableNamespace.default);
21
+ const callableLoadableNamespace = asLoadableNamespace(loadable_loadable);
22
+ const lazy = loadableNamespace.lazy ?? loadableDefaultNamespace.lazy ?? callableLoadableNamespace.lazy;
23
+ const loadableReady = loadableNamespace.loadableReady ?? loadableDefaultNamespace.loadableReady ?? callableLoadableNamespace.loadableReady;
24
+ const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = loadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadableDefaultNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? callableLoadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
19
25
  const exports_loadable = loadable_loadable;
20
26
  export default exports_loadable;
21
27
  export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, lazy, loadableReady };
@@ -23,6 +23,7 @@ const SLOW_EFFECTIVE_TYPES = new Set([
23
23
  const warmupCache = new Map();
24
24
  const warmupQueue = [];
25
25
  let activeWarmups = 0;
26
+ const getWarmupTimestamp = ()=>performance.now();
26
27
  const getConnection = ()=>{
27
28
  const nav = globalThis.navigator;
28
29
  return nav?.connection || nav?.mozConnection || nav?.webkitConnection;
@@ -33,7 +34,7 @@ const shouldWarmupOnCurrentNetwork = ()=>{
33
34
  if ('string' == typeof connection?.effectiveType && SLOW_EFFECTIVE_TYPES.has(connection.effectiveType)) return false;
34
35
  return true;
35
36
  };
36
- const pruneWarmupCache = (now = Date.now())=>{
37
+ const pruneWarmupCache = (now = getWarmupTimestamp())=>{
37
38
  for (const [key, timestamp] of warmupCache)if (now - timestamp > WARMUP_TTL) warmupCache.delete(key);
38
39
  };
39
40
  const runNextWarmup = ()=>{
@@ -54,7 +55,7 @@ const scheduleWarmup = (key, run)=>{
54
55
  if (!shouldWarmupOnCurrentNetwork()) return ()=>{};
55
56
  pruneWarmupCache();
56
57
  if (warmupCache.has(key)) return ()=>{};
57
- warmupCache.set(key, Date.now());
58
+ warmupCache.set(key, getWarmupTimestamp());
58
59
  const task = {
59
60
  key,
60
61
  run,
@@ -5,7 +5,7 @@ const outlet_Outlet = /*#__PURE__*/ memo(function() {
5
5
  return /*#__PURE__*/ jsx(Outlet, {});
6
6
  });
7
7
  function withModernRouteMatchContext(component, _routeId) {
8
- if (!component) return component;
8
+ if (null == component) return component;
9
9
  const Component = component;
10
10
  const WrappedRouteComponent = (props)=>/*#__PURE__*/ createElement(Component, props);
11
11
  const preloadable = component;
@@ -61,49 +61,46 @@ function getCachedRouteModule(routeId) {
61
61
  if ("u" < typeof window) return;
62
62
  return window[routeModulesKey]?.[routeId];
63
63
  }
64
- async function preloadHydratedRouteComponents(router) {
64
+ function preloadHydratedRouteComponents(router) {
65
65
  const preloadableRouter = router;
66
66
  const routesById = preloadableRouter.routesById || {};
67
67
  const matches = preloadableRouter.stores.matches.get();
68
- await Promise.all(matches.map((match)=>{
69
- if (!match.routeId) return;
68
+ return Promise.all(matches.map((match)=>{
69
+ if (void 0 === match.routeId || '' === match.routeId) return;
70
70
  const route = routesById[match.routeId];
71
71
  const component = route?.options?.component;
72
72
  const preload = component?.load || component?.preload;
73
73
  if ('function' != typeof preload) return;
74
74
  return Promise.resolve(preload.call(component)).then((routeModule)=>{
75
75
  const modernRouteId = route?.options?.staticData?.modernRouteId;
76
- const resolvedComponent = pickRouteModuleComponent(modernRouteId && getCachedRouteModule(modernRouteId) || routeModule);
77
- if (resolvedComponent && modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
76
+ const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
77
+ const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
78
+ if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
78
79
  });
79
- }));
80
+ })).then(()=>void 0);
80
81
  }
81
82
  function getTanstackSsrHydrationRecord(router) {
82
- let hydrationRecord = routerHydrationRecords.get(router);
83
- if (!hydrationRecord) {
84
- hydrationRecord = {
85
- promise: Promise.resolve(),
86
- status: 'pending'
87
- };
88
- routerHydrationRecords.set(router, hydrationRecord);
89
- try {
90
- hydrationRecord.promise = hydrate(router).then(async (value)=>{
91
- await preloadHydratedRouteComponents(router);
92
- return value;
93
- }).then((value)=>{
94
- hydrationRecord.status = 'fulfilled';
95
- return value;
96
- }, (error)=>{
97
- hydrationRecord.status = 'rejected';
98
- hydrationRecord.error = error;
99
- throw error;
100
- });
101
- } catch (error) {
83
+ const existingHydrationRecord = routerHydrationRecords.get(router);
84
+ if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
85
+ const hydrationRecord = {
86
+ promise: Promise.resolve(),
87
+ status: 'pending'
88
+ };
89
+ routerHydrationRecords.set(router, hydrationRecord);
90
+ try {
91
+ hydrationRecord.promise = hydrate(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
92
+ hydrationRecord.status = 'fulfilled';
93
+ return value;
94
+ }, (error)=>{
102
95
  hydrationRecord.status = 'rejected';
103
96
  hydrationRecord.error = error;
104
- hydrationRecord.promise = Promise.reject(error);
105
- hydrationRecord.promise.catch(()=>{});
106
- }
97
+ throw error;
98
+ });
99
+ } catch (error) {
100
+ hydrationRecord.status = 'rejected';
101
+ hydrationRecord.error = error;
102
+ hydrationRecord.promise = Promise.reject(error);
103
+ hydrationRecord.promise.catch(()=>{});
107
104
  }
108
105
  return hydrationRecord;
109
106
  }
@@ -224,13 +221,13 @@ const tanstackRouterPlugin = (userConfig = {})=>({
224
221
  });
225
222
  return cachedRouter;
226
223
  };
227
- api.onBeforeRender(async (context)=>{
224
+ api.onBeforeRender((context)=>{
228
225
  const mergedConfig = getMergedConfig();
229
- if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
226
+ if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
230
227
  const { ssrContext } = context;
231
228
  const currentPathname = normalizePathname(window.location.pathname);
232
- const initialPathname = ssrContext?.request?.pathname && normalizePathname(ssrContext.request.pathname);
233
- if (initialPathname && initialPathname !== currentPathname) {
229
+ const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? normalizePathname(ssrContext.request.pathname) : void 0;
230
+ if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
234
231
  const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
235
232
  console.error(errorMsg);
236
233
  window.location.reload();
@@ -244,14 +241,14 @@ const tanstackRouterPlugin = (userConfig = {})=>({
244
241
  useRouter: useRouter
245
242
  };
246
243
  const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
247
- if (hasSSRBootstrap && getRouteObjects().length) {
244
+ if (hasSSRBootstrap && getRouteObjects().length > 0) {
248
245
  const runtimeContext = context;
249
246
  const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
250
- if (router) await getTanstackSsrHydrationPromise(router);
247
+ if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
251
248
  }
252
249
  });
253
250
  api.wrapRoot((App)=>{
254
- if (!getRouteObjects().length) return App;
251
+ if (0 === getRouteObjects().length) return App;
255
252
  const RouterWrapper = ()=>{
256
253
  const runtimeContext = useContext(InternalRuntimeContext);
257
254
  const _basename = getClientBasename(runtimeContext);
@@ -51,7 +51,7 @@ const readQueryEnabledOverride = ()=>{
51
51
  const detectLanguage = ()=>{
52
52
  if ("u" < typeof document) return 'en';
53
53
  const htmlLanguage = document.documentElement.lang;
54
- if (htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
54
+ if ('' !== htmlLanguage) return htmlLanguage.split('-')[0] || 'en';
55
55
  if ("u" < typeof window) return 'en';
56
56
  return window.location.pathname.split('/').filter(Boolean)[0] || 'en';
57
57
  };
@@ -70,7 +70,7 @@ const getBoundaryId = (element)=>element.dataset.modernBoundaryId ?? element.dat
70
70
  const collectBoundaryElements = (legacySelector)=>{
71
71
  const elements = new Set();
72
72
  for (const element of document.querySelectorAll(boundarySelector))elements.add(element);
73
- if (!legacySelector) return Array.from(elements);
73
+ if (void 0 === legacySelector || '' === legacySelector) return Array.from(elements);
74
74
  try {
75
75
  for (const element of document.querySelectorAll(legacySelector))elements.add(element);
76
76
  } catch {}
@@ -114,7 +114,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
114
114
  const seenBoxes = new Set();
115
115
  const nextBoxes = collectBoundaryElements(legacySelector).map((element)=>{
116
116
  const boundaryId = getBoundaryId(element);
117
- if (!boundaryId) return;
117
+ if (void 0 === boundaryId || '' === boundaryId) return;
118
118
  const rect = element.getBoundingClientRect();
119
119
  if (rect.width <= 0 || rect.height <= 0) return;
120
120
  const rectKey = formatRectKey(rect);
@@ -125,7 +125,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
125
125
  const color = boundary?.color ?? palette[hashBoundaryId(boundaryId) % palette.length];
126
126
  const label = boundary?.label ?? boundary?.appId ?? boundaryId;
127
127
  const expose = element.dataset.modernMfExpose;
128
- const detail = expose && expose !== label && expose !== boundaryId ? expose : void 0;
128
+ const detail = void 0 !== expose && '' !== expose && expose !== label && expose !== boundaryId ? expose : void 0;
129
129
  const box = {
130
130
  color,
131
131
  height: rect.height,
@@ -135,7 +135,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
135
135
  top: rect.top,
136
136
  width: rect.width
137
137
  };
138
- if (detail) box.detail = detail;
138
+ if (void 0 !== detail) box.detail = detail;
139
139
  return box;
140
140
  }).filter((box)=>void 0 !== box);
141
141
  setBoxes(nextBoxes);
@@ -228,7 +228,7 @@ function BoundaryDebugger({ controlMode = 'visible', enabledByDefault = false, l
228
228
  /*#__PURE__*/ jsx("span", {
229
229
  children: box.label
230
230
  }),
231
- box.detail ? /*#__PURE__*/ jsx("span", {
231
+ void 0 !== box.detail && '' !== box.detail ? /*#__PURE__*/ jsx("span", {
232
232
  style: {
233
233
  font: '700 10px/1.1 system-ui, sans-serif',
234
234
  opacity: 0.82,
@@ -1,11 +1,11 @@
1
1
  import "node:module";
2
2
  import { attributesToString } from "./utils.mjs";
3
3
  const createFederatedCssLinks = (assets, options)=>{
4
- if (!assets?.length) return '';
4
+ if (void 0 === assets || 0 === assets.length) return '';
5
5
  const seen = new Set(options.existingAssets || []);
6
6
  const attributes = attributesToString(options.attributes || {});
7
7
  const links = [];
8
- for (const asset of assets)if (!(!asset || seen.has(asset) || options.template.includes(asset))) {
8
+ for (const asset of assets)if (!('' === asset || seen.has(asset) || options.template.includes(asset))) {
9
9
  seen.add(asset);
10
10
  links.push(`<link${attributes} href="${asset}" rel="stylesheet" />`);
11
11
  }
@@ -17,10 +17,10 @@ function isEntryScript(src, entryName, asyncEntry) {
17
17
  return basename === `${prefix}.js` || basename.startsWith(`${prefix}.`) || basename.startsWith(`${prefix}-`);
18
18
  }
19
19
  function injectBeforeHydrationEntryScript(template, scripts, entryName = 'index') {
20
- if (!scripts) return template;
20
+ if ('' === scripts) return template;
21
21
  const scriptTags = getScriptTags(template);
22
22
  const target = scriptTags.find((match)=>isEntryScript(match.src, entryName, false)) ?? scriptTags.find((match)=>isEntryScript(match.src, entryName, true));
23
- if (!target) return template;
23
+ if (void 0 === target) return template;
24
24
  return `${template.slice(0, target.index)}${scripts}${template.slice(target.index)}`;
25
25
  }
26
26
  export { injectBeforeHydrationEntryScript };
@@ -49,7 +49,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
49
49
  if (!index) return;
50
50
  const routeId = match.route.id;
51
51
  if (routeId) return routeAssets[routeId];
52
- }).filter(Boolean) ?? [];
52
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
53
53
  }
54
54
  const asyncEntry = routeAssets[`async-${entryName}`];
55
55
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -40,7 +40,7 @@ async function buildShellBeforeTemplate(beforeAppTemplate, options) {
40
40
  if (!index) return;
41
41
  const routeId = match.route.id;
42
42
  if (routeId) return routeAssets[routeId];
43
- }).filter(Boolean) ?? [];
43
+ }).filter((routeManifest)=>void 0 !== routeManifest) ?? [];
44
44
  }
45
45
  const asyncEntry = routeAssets[`async-${entryName}`];
46
46
  if (asyncEntry) matchedRouteManifests.push(asyncEntry);
@@ -41,7 +41,7 @@ const createAttributeDatum = (attributes)=>({
41
41
  const createTitleDatum = (title, attributes)=>({
42
42
  toComponent: ()=>[],
43
43
  toString: ()=>{
44
- if (!title) return '';
44
+ if (void 0 === title || '' === title) return '';
45
45
  const attrs = attributesToString(attributes, true);
46
46
  return `<title ${attrs}>${escapeHtml(title)}</title>`;
47
47
  }
@@ -58,6 +58,10 @@ const createEmptyHelmetState = ()=>({
58
58
  style: createDatum('style', []),
59
59
  title: createTitleDatum(void 0, {})
60
60
  });
61
+ const normalizeHelmetTitle = (title)=>{
62
+ if ('string' == typeof title) return title;
63
+ if (Array.isArray(title)) return title.map((part)=>String(part)).join('');
64
+ };
61
65
  const mergeAttributes = (current, next)=>({
62
66
  ...current,
63
67
  ...next ?? {}
@@ -87,7 +91,7 @@ const collectHelmetProps = (current, props)=>{
87
91
  const baseState = current ?? createEmptyHelmetState();
88
92
  const draft = {
89
93
  base: [
90
- ...props.base ? [
94
+ ...void 0 !== props.base ? [
91
95
  props.base
92
96
  ] : []
93
97
  ],
@@ -108,11 +112,11 @@ const collectHelmetProps = (current, props)=>{
108
112
  style: [
109
113
  ...props.style ?? []
110
114
  ],
111
- title: 'string' == typeof props.title ? props.title : Array.isArray(props.title) ? props.title.join('') : void 0,
115
+ title: normalizeHelmetTitle(props.title),
112
116
  titleAttributes: props.titleAttributes ?? {}
113
117
  };
114
118
  collectChildren(props.children, draft);
115
- const title = draft.title && props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
119
+ const title = void 0 !== draft.title && '' !== draft.title && void 0 !== props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
116
120
  return {
117
121
  base: createDatum('base', [
118
122
  ...baseState.__baseTags ?? [],
@@ -174,7 +178,7 @@ const collectHelmetProps = (current, props)=>{
174
178
  };
175
179
  const head_Helmet = (props)=>{
176
180
  const runtimeContext = react.useContext(InternalRuntimeContext);
177
- if (runtimeContext && !runtimeContext.isBrowser) {
181
+ if (null !== runtimeContext && false === runtimeContext.isBrowser) {
178
182
  runtimeContext._helmetContext ??= {};
179
183
  runtimeContext._helmetContext.helmet = collectHelmetProps(runtimeContext._helmetContext.helmet ?? void 0, props);
180
184
  return null;
@@ -1,22 +1,28 @@
1
1
  import "node:module";
2
2
  import * as __rspack_external__loadable_component_0aaae075 from "@loadable/component";
3
3
  export * from "@loadable/component";
4
+ function asLoadableNamespace(value) {
5
+ return 'object' == typeof value && null !== value ? value : {};
6
+ }
4
7
  function resolveLoadable(module) {
5
- const namespace = module;
6
- const defaultExport = namespace.default;
8
+ const namespace = asLoadableNamespace(module);
9
+ const defaultExport = asLoadableNamespace(namespace.default);
7
10
  const candidates = [
8
11
  module,
9
12
  namespace.default,
10
13
  defaultExport?.default
11
14
  ];
12
15
  const loadable = candidates.find((candidate)=>'function' == typeof candidate);
13
- if (!loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
16
+ if ('function' != typeof loadable) throw new TypeError('Modern.js runtime loadable export must resolve to a function');
14
17
  return loadable;
15
18
  }
16
19
  const loadable_loadable = resolveLoadable(__rspack_external__loadable_component_0aaae075);
17
- const lazy = __rspack_external__loadable_component_0aaae075.lazy ?? __rspack_external__loadable_component_0aaae075["default"]?.lazy ?? loadable_loadable.lazy;
18
- const loadableReady = __rspack_external__loadable_component_0aaae075.loadableReady ?? __rspack_external__loadable_component_0aaae075["default"]?.loadableReady ?? loadable_loadable.loadableReady;
19
- const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = __rspack_external__loadable_component_0aaae075.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? __rspack_external__loadable_component_0aaae075["default"]?.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadable_loadable.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
20
+ const loadableNamespace = asLoadableNamespace(__rspack_external__loadable_component_0aaae075);
21
+ const loadableDefaultNamespace = asLoadableNamespace(loadableNamespace.default);
22
+ const callableLoadableNamespace = asLoadableNamespace(loadable_loadable);
23
+ const lazy = loadableNamespace.lazy ?? loadableDefaultNamespace.lazy ?? callableLoadableNamespace.lazy;
24
+ const loadableReady = loadableNamespace.loadableReady ?? loadableDefaultNamespace.loadableReady ?? callableLoadableNamespace.loadableReady;
25
+ const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = loadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? loadableDefaultNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ?? callableLoadableNamespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
20
26
  const exports_loadable = loadable_loadable;
21
27
  export default exports_loadable;
22
28
  export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, lazy, loadableReady };
@@ -24,6 +24,7 @@ const SLOW_EFFECTIVE_TYPES = new Set([
24
24
  const warmupCache = new Map();
25
25
  const warmupQueue = [];
26
26
  let activeWarmups = 0;
27
+ const getWarmupTimestamp = ()=>performance.now();
27
28
  const getConnection = ()=>{
28
29
  const nav = globalThis.navigator;
29
30
  return nav?.connection || nav?.mozConnection || nav?.webkitConnection;
@@ -34,7 +35,7 @@ const shouldWarmupOnCurrentNetwork = ()=>{
34
35
  if ('string' == typeof connection?.effectiveType && SLOW_EFFECTIVE_TYPES.has(connection.effectiveType)) return false;
35
36
  return true;
36
37
  };
37
- const pruneWarmupCache = (now = Date.now())=>{
38
+ const pruneWarmupCache = (now = getWarmupTimestamp())=>{
38
39
  for (const [key, timestamp] of warmupCache)if (now - timestamp > WARMUP_TTL) warmupCache.delete(key);
39
40
  };
40
41
  const runNextWarmup = ()=>{
@@ -55,7 +56,7 @@ const scheduleWarmup = (key, run)=>{
55
56
  if (!shouldWarmupOnCurrentNetwork()) return ()=>{};
56
57
  pruneWarmupCache();
57
58
  if (warmupCache.has(key)) return ()=>{};
58
- warmupCache.set(key, Date.now());
59
+ warmupCache.set(key, getWarmupTimestamp());
59
60
  const task = {
60
61
  key,
61
62
  run,
@@ -6,7 +6,7 @@ const outlet_Outlet = /*#__PURE__*/ memo(function() {
6
6
  return /*#__PURE__*/ jsx(Outlet, {});
7
7
  });
8
8
  function withModernRouteMatchContext(component, _routeId) {
9
- if (!component) return component;
9
+ if (null == component) return component;
10
10
  const Component = component;
11
11
  const WrappedRouteComponent = (props)=>/*#__PURE__*/ createElement(Component, props);
12
12
  const preloadable = component;
@@ -62,49 +62,46 @@ function getCachedRouteModule(routeId) {
62
62
  if ("u" < typeof window) return;
63
63
  return window[routeModulesKey]?.[routeId];
64
64
  }
65
- async function preloadHydratedRouteComponents(router) {
65
+ function preloadHydratedRouteComponents(router) {
66
66
  const preloadableRouter = router;
67
67
  const routesById = preloadableRouter.routesById || {};
68
68
  const matches = preloadableRouter.stores.matches.get();
69
- await Promise.all(matches.map((match)=>{
70
- if (!match.routeId) return;
69
+ return Promise.all(matches.map((match)=>{
70
+ if (void 0 === match.routeId || '' === match.routeId) return;
71
71
  const route = routesById[match.routeId];
72
72
  const component = route?.options?.component;
73
73
  const preload = component?.load || component?.preload;
74
74
  if ('function' != typeof preload) return;
75
75
  return Promise.resolve(preload.call(component)).then((routeModule)=>{
76
76
  const modernRouteId = route?.options?.staticData?.modernRouteId;
77
- const resolvedComponent = pickRouteModuleComponent(modernRouteId && getCachedRouteModule(modernRouteId) || routeModule);
78
- if (resolvedComponent && modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
77
+ const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
78
+ const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
79
+ if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
79
80
  });
80
- }));
81
+ })).then(()=>void 0);
81
82
  }
82
83
  function getTanstackSsrHydrationRecord(router) {
83
- let hydrationRecord = routerHydrationRecords.get(router);
84
- if (!hydrationRecord) {
85
- hydrationRecord = {
86
- promise: Promise.resolve(),
87
- status: 'pending'
88
- };
89
- routerHydrationRecords.set(router, hydrationRecord);
90
- try {
91
- hydrationRecord.promise = hydrate(router).then(async (value)=>{
92
- await preloadHydratedRouteComponents(router);
93
- return value;
94
- }).then((value)=>{
95
- hydrationRecord.status = 'fulfilled';
96
- return value;
97
- }, (error)=>{
98
- hydrationRecord.status = 'rejected';
99
- hydrationRecord.error = error;
100
- throw error;
101
- });
102
- } catch (error) {
84
+ const existingHydrationRecord = routerHydrationRecords.get(router);
85
+ if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
86
+ const hydrationRecord = {
87
+ promise: Promise.resolve(),
88
+ status: 'pending'
89
+ };
90
+ routerHydrationRecords.set(router, hydrationRecord);
91
+ try {
92
+ hydrationRecord.promise = hydrate(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
93
+ hydrationRecord.status = 'fulfilled';
94
+ return value;
95
+ }, (error)=>{
103
96
  hydrationRecord.status = 'rejected';
104
97
  hydrationRecord.error = error;
105
- hydrationRecord.promise = Promise.reject(error);
106
- hydrationRecord.promise.catch(()=>{});
107
- }
98
+ throw error;
99
+ });
100
+ } catch (error) {
101
+ hydrationRecord.status = 'rejected';
102
+ hydrationRecord.error = error;
103
+ hydrationRecord.promise = Promise.reject(error);
104
+ hydrationRecord.promise.catch(()=>{});
108
105
  }
109
106
  return hydrationRecord;
110
107
  }
@@ -225,13 +222,13 @@ const tanstackRouterPlugin = (userConfig = {})=>({
225
222
  });
226
223
  return cachedRouter;
227
224
  };
228
- api.onBeforeRender(async (context)=>{
225
+ api.onBeforeRender((context)=>{
229
226
  const mergedConfig = getMergedConfig();
230
- if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
227
+ if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
231
228
  const { ssrContext } = context;
232
229
  const currentPathname = normalizePathname(window.location.pathname);
233
- const initialPathname = ssrContext?.request?.pathname && normalizePathname(ssrContext.request.pathname);
234
- if (initialPathname && initialPathname !== currentPathname) {
230
+ const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? normalizePathname(ssrContext.request.pathname) : void 0;
231
+ if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
235
232
  const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
236
233
  console.error(errorMsg);
237
234
  window.location.reload();
@@ -245,14 +242,14 @@ const tanstackRouterPlugin = (userConfig = {})=>({
245
242
  useRouter: useRouter
246
243
  };
247
244
  const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
248
- if (hasSSRBootstrap && getRouteObjects().length) {
245
+ if (hasSSRBootstrap && getRouteObjects().length > 0) {
249
246
  const runtimeContext = context;
250
247
  const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
251
- if (router) await getTanstackSsrHydrationPromise(router);
248
+ if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
252
249
  }
253
250
  });
254
251
  api.wrapRoot((App)=>{
255
- if (!getRouteObjects().length) return App;
252
+ if (0 === getRouteObjects().length) return App;
256
253
  const RouterWrapper = ()=>{
257
254
  const runtimeContext = useContext(InternalRuntimeContext);
258
255
  const _basename = getClientBasename(runtimeContext);
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { Helmet as AsyncHelmet, HelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
2
+ import { Helmet as AsyncHelmet, HelmetData as AsyncHelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
3
3
  export declare const Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.CElement<React.PropsWithChildren<HelmetProps>, AsyncHelmet> | null;
4
4
  declare const head: {
5
5
  Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.CElement<React.PropsWithChildren<HelmetProps>, AsyncHelmet> | null;
6
- HelmetData: typeof HelmetData;
6
+ HelmetData: typeof AsyncHelmetData;
7
7
  HelmetProvider: typeof HelmetProvider;
8
8
  };
9
9
  export default head;
10
- export type { HelmetDatum, HelmetHTMLBodyDatum, HelmetHTMLElementDatum, HelmetProps, HelmetServerState as HelmetData, HelmetTags, };
11
- export { HelmetData, HelmetProvider };
10
+ export type { HelmetDatum, HelmetHTMLBodyDatum, HelmetHTMLElementDatum, HelmetProps, HelmetServerState, HelmetTags, };
11
+ export { AsyncHelmetData as HelmetData, HelmetProvider };
@@ -1,7 +1,7 @@
1
1
  type LoadableDefault = typeof import('@loadable/component').default;
2
2
  type LoadableLazy = typeof import('@loadable/component').lazy;
3
3
  type LoadableReady = typeof import('@loadable/component').loadableReady;
4
- type LoadableInternals = typeof import('@loadable/component').__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4
+ type LoadableInternals = unknown;
5
5
  declare const loadable: LoadableDefault;
6
6
  export declare const lazy: LoadableLazy;
7
7
  export declare const loadableReady: LoadableReady;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.103",
20
+ "version": "3.2.0-ultramodern.104",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -233,12 +233,12 @@
233
233
  "isbot": "5.1.40",
234
234
  "react-helmet-async": "3.0.0",
235
235
  "react-is": "^19.2.6",
236
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.103",
237
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.103",
238
- "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.103",
239
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.103",
240
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.103",
241
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.103"
236
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.104",
237
+ "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.104",
238
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.104",
239
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.104",
240
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.104",
241
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.104"
242
242
  },
243
243
  "peerDependencies": {
244
244
  "react": "^19.2.6",
@@ -257,7 +257,7 @@
257
257
  "@typescript/native-preview": "7.0.0-dev.20260527.2",
258
258
  "react": "^19.2.6",
259
259
  "react-dom": "^19.2.6",
260
- "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.103",
260
+ "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.104",
261
261
  "@scripts/rstest-config": "2.66.0"
262
262
  },
263
263
  "sideEffects": false,