@tanstack/router-plugin 1.167.9 → 1.167.10

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.
@@ -14,6 +14,7 @@ function createHotDataKey(exportName) {
14
14
  var buildStableSplitComponentStatements = _babel_template.statements(`
15
15
  const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)
16
16
  if (import.meta.hot) {
17
+ import.meta.hot.data ??= {}
17
18
  import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%
18
19
  }
19
20
  `, { syntacticPlaceholders: true });
@@ -1 +1 @@
1
- {"version":3,"file":"react-stable-hmr-split-route-components.cjs","names":[],"sources":["../../../../../src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts"],"sourcesContent":["import * as template from '@babel/template'\nimport * as t from '@babel/types'\nimport { getUniqueProgramIdentifier } from '../../utils'\nimport type { ReferenceRouteCompilerPlugin } from '../plugins'\n\nfunction capitalizeIdentifier(str: string) {\n return str[0]!.toUpperCase() + str.slice(1)\n}\n\nfunction createHotDataKey(exportName: string) {\n return `tsr-split-component:${exportName}`\n}\n\nconst buildStableSplitComponentStatements = template.statements(\n `\n const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)\n if (import.meta.hot) {\n import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%\n }\n `,\n {\n syntacticPlaceholders: true,\n },\n)\n\nexport function createReactStableHmrSplitRouteComponentsPlugin(): ReferenceRouteCompilerPlugin {\n return {\n name: 'react-stable-hmr-split-route-components',\n onSplitRouteProperty(ctx) {\n if (ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent') {\n return\n }\n\n const stableComponentIdent = getUniqueProgramIdentifier(\n ctx.programPath,\n `TSRSplit${capitalizeIdentifier(ctx.splitNodeMeta.exporterIdent)}`,\n )\n\n const hotDataKey = createHotDataKey(ctx.splitNodeMeta.exporterIdent)\n\n ctx.insertionPath.insertBefore(\n buildStableSplitComponentStatements({\n stableComponentIdent,\n hotDataKey: t.stringLiteral(hotDataKey),\n lazyRouteComponentIdent: t.identifier(ctx.lazyRouteComponentIdent),\n localImporterIdent: t.identifier(\n ctx.splitNodeMeta.localImporterIdent,\n ),\n exporterIdent: t.stringLiteral(ctx.splitNodeMeta.exporterIdent),\n }),\n )\n\n return t.identifier(stableComponentIdent.name)\n },\n }\n}\n"],"mappings":";;;;;;;AAKA,SAAS,qBAAqB,KAAa;AACzC,QAAO,IAAI,GAAI,aAAa,GAAG,IAAI,MAAM,EAAE;;AAG7C,SAAS,iBAAiB,YAAoB;AAC5C,QAAO,uBAAuB;;AAGhC,IAAM,sCAAsC,gBAAS,WACnD;;;;;KAMA,EACE,uBAAuB,MACxB,CACF;AAED,SAAgB,iDAA+E;AAC7F,QAAO;EACL,MAAM;EACN,qBAAqB,KAAK;AACxB,OAAI,IAAI,cAAc,kBAAkB,qBACtC;GAGF,MAAM,uBAAuB,cAAA,2BAC3B,IAAI,aACJ,WAAW,qBAAqB,IAAI,cAAc,cAAc,GACjE;GAED,MAAM,aAAa,iBAAiB,IAAI,cAAc,cAAc;AAEpE,OAAI,cAAc,aAChB,oCAAoC;IAClC;IACA,YAAY,aAAE,cAAc,WAAW;IACvC,yBAAyB,aAAE,WAAW,IAAI,wBAAwB;IAClE,oBAAoB,aAAE,WACpB,IAAI,cAAc,mBACnB;IACD,eAAe,aAAE,cAAc,IAAI,cAAc,cAAc;IAChE,CAAC,CACH;AAED,UAAO,aAAE,WAAW,qBAAqB,KAAK;;EAEjD"}
1
+ {"version":3,"file":"react-stable-hmr-split-route-components.cjs","names":[],"sources":["../../../../../src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts"],"sourcesContent":["import * as template from '@babel/template'\nimport * as t from '@babel/types'\nimport { getUniqueProgramIdentifier } from '../../utils'\nimport type { ReferenceRouteCompilerPlugin } from '../plugins'\n\nfunction capitalizeIdentifier(str: string) {\n return str[0]!.toUpperCase() + str.slice(1)\n}\n\nfunction createHotDataKey(exportName: string) {\n return `tsr-split-component:${exportName}`\n}\n\nconst buildStableSplitComponentStatements = template.statements(\n `\n const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)\n if (import.meta.hot) {\n import.meta.hot.data ??= {}\n import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%\n }\n `,\n {\n syntacticPlaceholders: true,\n },\n)\n\nexport function createReactStableHmrSplitRouteComponentsPlugin(): ReferenceRouteCompilerPlugin {\n return {\n name: 'react-stable-hmr-split-route-components',\n onSplitRouteProperty(ctx) {\n if (ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent') {\n return\n }\n\n const stableComponentIdent = getUniqueProgramIdentifier(\n ctx.programPath,\n `TSRSplit${capitalizeIdentifier(ctx.splitNodeMeta.exporterIdent)}`,\n )\n\n const hotDataKey = createHotDataKey(ctx.splitNodeMeta.exporterIdent)\n\n ctx.insertionPath.insertBefore(\n buildStableSplitComponentStatements({\n stableComponentIdent,\n hotDataKey: t.stringLiteral(hotDataKey),\n lazyRouteComponentIdent: t.identifier(ctx.lazyRouteComponentIdent),\n localImporterIdent: t.identifier(\n ctx.splitNodeMeta.localImporterIdent,\n ),\n exporterIdent: t.stringLiteral(ctx.splitNodeMeta.exporterIdent),\n }),\n )\n\n return t.identifier(stableComponentIdent.name)\n },\n }\n}\n"],"mappings":";;;;;;;AAKA,SAAS,qBAAqB,KAAa;AACzC,QAAO,IAAI,GAAI,aAAa,GAAG,IAAI,MAAM,EAAE;;AAG7C,SAAS,iBAAiB,YAAoB;AAC5C,QAAO,uBAAuB;;AAGhC,IAAM,sCAAsC,gBAAS,WACnD;;;;;;KAOA,EACE,uBAAuB,MACxB,CACF;AAED,SAAgB,iDAA+E;AAC7F,QAAO;EACL,MAAM;EACN,qBAAqB,KAAK;AACxB,OAAI,IAAI,cAAc,kBAAkB,qBACtC;GAGF,MAAM,uBAAuB,cAAA,2BAC3B,IAAI,aACJ,WAAW,qBAAqB,IAAI,cAAc,cAAc,GACjE;GAED,MAAM,aAAa,iBAAiB,IAAI,cAAc,cAAc;AAEpE,OAAI,cAAc,aAChB,oCAAoC;IAClC;IACA,YAAY,aAAE,cAAc,WAAW;IACvC,yBAAyB,aAAE,WAAW,IAAI,wBAAwB;IAClE,oBAAoB,aAAE,WACpB,IAAI,cAAc,mBACnB;IACD,eAAe,aAAE,cAAc,IAAI,cAAc,cAAc;IAChE,CAAC,CACH;AAED,UAAO,aAAE,WAAW,qBAAqB,KAAK;;EAEjD"}
@@ -11,6 +11,7 @@ function createHotDataKey(exportName) {
11
11
  var buildStableSplitComponentStatements = template.statements(`
12
12
  const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)
13
13
  if (import.meta.hot) {
14
+ import.meta.hot.data ??= {}
14
15
  import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%
15
16
  }
16
17
  `, { syntacticPlaceholders: true });
@@ -1 +1 @@
1
- {"version":3,"file":"react-stable-hmr-split-route-components.js","names":[],"sources":["../../../../../src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts"],"sourcesContent":["import * as template from '@babel/template'\nimport * as t from '@babel/types'\nimport { getUniqueProgramIdentifier } from '../../utils'\nimport type { ReferenceRouteCompilerPlugin } from '../plugins'\n\nfunction capitalizeIdentifier(str: string) {\n return str[0]!.toUpperCase() + str.slice(1)\n}\n\nfunction createHotDataKey(exportName: string) {\n return `tsr-split-component:${exportName}`\n}\n\nconst buildStableSplitComponentStatements = template.statements(\n `\n const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)\n if (import.meta.hot) {\n import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%\n }\n `,\n {\n syntacticPlaceholders: true,\n },\n)\n\nexport function createReactStableHmrSplitRouteComponentsPlugin(): ReferenceRouteCompilerPlugin {\n return {\n name: 'react-stable-hmr-split-route-components',\n onSplitRouteProperty(ctx) {\n if (ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent') {\n return\n }\n\n const stableComponentIdent = getUniqueProgramIdentifier(\n ctx.programPath,\n `TSRSplit${capitalizeIdentifier(ctx.splitNodeMeta.exporterIdent)}`,\n )\n\n const hotDataKey = createHotDataKey(ctx.splitNodeMeta.exporterIdent)\n\n ctx.insertionPath.insertBefore(\n buildStableSplitComponentStatements({\n stableComponentIdent,\n hotDataKey: t.stringLiteral(hotDataKey),\n lazyRouteComponentIdent: t.identifier(ctx.lazyRouteComponentIdent),\n localImporterIdent: t.identifier(\n ctx.splitNodeMeta.localImporterIdent,\n ),\n exporterIdent: t.stringLiteral(ctx.splitNodeMeta.exporterIdent),\n }),\n )\n\n return t.identifier(stableComponentIdent.name)\n },\n }\n}\n"],"mappings":";;;;AAKA,SAAS,qBAAqB,KAAa;AACzC,QAAO,IAAI,GAAI,aAAa,GAAG,IAAI,MAAM,EAAE;;AAG7C,SAAS,iBAAiB,YAAoB;AAC5C,QAAO,uBAAuB;;AAGhC,IAAM,sCAAsC,SAAS,WACnD;;;;;KAMA,EACE,uBAAuB,MACxB,CACF;AAED,SAAgB,iDAA+E;AAC7F,QAAO;EACL,MAAM;EACN,qBAAqB,KAAK;AACxB,OAAI,IAAI,cAAc,kBAAkB,qBACtC;GAGF,MAAM,uBAAuB,2BAC3B,IAAI,aACJ,WAAW,qBAAqB,IAAI,cAAc,cAAc,GACjE;GAED,MAAM,aAAa,iBAAiB,IAAI,cAAc,cAAc;AAEpE,OAAI,cAAc,aAChB,oCAAoC;IAClC;IACA,YAAY,EAAE,cAAc,WAAW;IACvC,yBAAyB,EAAE,WAAW,IAAI,wBAAwB;IAClE,oBAAoB,EAAE,WACpB,IAAI,cAAc,mBACnB;IACD,eAAe,EAAE,cAAc,IAAI,cAAc,cAAc;IAChE,CAAC,CACH;AAED,UAAO,EAAE,WAAW,qBAAqB,KAAK;;EAEjD"}
1
+ {"version":3,"file":"react-stable-hmr-split-route-components.js","names":[],"sources":["../../../../../src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts"],"sourcesContent":["import * as template from '@babel/template'\nimport * as t from '@babel/types'\nimport { getUniqueProgramIdentifier } from '../../utils'\nimport type { ReferenceRouteCompilerPlugin } from '../plugins'\n\nfunction capitalizeIdentifier(str: string) {\n return str[0]!.toUpperCase() + str.slice(1)\n}\n\nfunction createHotDataKey(exportName: string) {\n return `tsr-split-component:${exportName}`\n}\n\nconst buildStableSplitComponentStatements = template.statements(\n `\n const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)\n if (import.meta.hot) {\n import.meta.hot.data ??= {}\n import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%\n }\n `,\n {\n syntacticPlaceholders: true,\n },\n)\n\nexport function createReactStableHmrSplitRouteComponentsPlugin(): ReferenceRouteCompilerPlugin {\n return {\n name: 'react-stable-hmr-split-route-components',\n onSplitRouteProperty(ctx) {\n if (ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent') {\n return\n }\n\n const stableComponentIdent = getUniqueProgramIdentifier(\n ctx.programPath,\n `TSRSplit${capitalizeIdentifier(ctx.splitNodeMeta.exporterIdent)}`,\n )\n\n const hotDataKey = createHotDataKey(ctx.splitNodeMeta.exporterIdent)\n\n ctx.insertionPath.insertBefore(\n buildStableSplitComponentStatements({\n stableComponentIdent,\n hotDataKey: t.stringLiteral(hotDataKey),\n lazyRouteComponentIdent: t.identifier(ctx.lazyRouteComponentIdent),\n localImporterIdent: t.identifier(\n ctx.splitNodeMeta.localImporterIdent,\n ),\n exporterIdent: t.stringLiteral(ctx.splitNodeMeta.exporterIdent),\n }),\n )\n\n return t.identifier(stableComponentIdent.name)\n },\n }\n}\n"],"mappings":";;;;AAKA,SAAS,qBAAqB,KAAa;AACzC,QAAO,IAAI,GAAI,aAAa,GAAG,IAAI,MAAM,EAAE;;AAG7C,SAAS,iBAAiB,YAAoB;AAC5C,QAAO,uBAAuB;;AAGhC,IAAM,sCAAsC,SAAS,WACnD;;;;;;KAOA,EACE,uBAAuB,MACxB,CACF;AAED,SAAgB,iDAA+E;AAC7F,QAAO;EACL,MAAM;EACN,qBAAqB,KAAK;AACxB,OAAI,IAAI,cAAc,kBAAkB,qBACtC;GAGF,MAAM,uBAAuB,2BAC3B,IAAI,aACJ,WAAW,qBAAqB,IAAI,cAAc,cAAc,GACjE;GAED,MAAM,aAAa,iBAAiB,IAAI,cAAc,cAAc;AAEpE,OAAI,cAAc,aAChB,oCAAoC;IAClC;IACA,YAAY,EAAE,cAAc,WAAW;IACvC,yBAAyB,EAAE,WAAW,IAAI,wBAAwB;IAClE,oBAAoB,EAAE,WACpB,IAAI,cAAc,mBACnB;IACD,eAAe,EAAE,cAAc,IAAI,cAAc,cAAc;IAChE,CAAC,CACH;AAED,UAAO,EAAE,WAAW,qBAAqB,KAAK;;EAEjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-plugin",
3
- "version": "1.167.9",
3
+ "version": "1.167.10",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -15,6 +15,7 @@ const buildStableSplitComponentStatements = template.statements(
15
15
  `
16
16
  const %%stableComponentIdent%% = import.meta.hot?.data?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%)
17
17
  if (import.meta.hot) {
18
+ import.meta.hot.data ??= {}
18
19
  import.meta.hot.data[%%hotDataKey%%] = %%stableComponentIdent%%
19
20
  }
20
21
  `,