nuxt-nightly 4.1.2-29293741.3f7624b3 → 4.1.2-29293755.13aef2ae

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 (2) hide show
  1. package/dist/index.mjs +21 -23
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -3137,7 +3137,7 @@ const hydrationStrategyMap = {
3137
3137
  hydrateWhen: "If",
3138
3138
  hydrateNever: "Never"
3139
3139
  };
3140
- const LAZY_HYDRATION_PROPS_RE = /\b(?:hydrate-on-idle|hydrateOnIdle|hydrate-on-visible|hydrateOnVisible|hydrate-on-interaction|hydrateOnInteraction|hydrate-on-media-query|hydrateOnMediaQuery|hydrate-after|hydrateAfter|hydrate-when|hydrateWhen|hydrate-never|hydrateNever)\b/;
3140
+ const TEMPLATE_WITH_LAZY_HYDRATION_RE = /<template>[\s\S]*\b(?:hydrate-on-idle|hydrateOnIdle|hydrate-on-visible|hydrateOnVisible|hydrate-on-interaction|hydrateOnInteraction|hydrate-on-media-query|hydrateOnMediaQuery|hydrate-after|hydrateAfter|hydrate-when|hydrateWhen|hydrate-never|hydrateNever)\b[\s\S]*<\/template>/;
3141
3141
  const LazyHydrationTransformPlugin = (options) => createUnplugin(() => {
3142
3142
  const exclude = options.transform?.exclude || [];
3143
3143
  const include = options.transform?.include || [];
@@ -3156,28 +3156,26 @@ const LazyHydrationTransformPlugin = (options) => createUnplugin(() => {
3156
3156
  },
3157
3157
  transform: {
3158
3158
  filter: {
3159
- code: { include: TEMPLATE_RE }
3159
+ code: { include: TEMPLATE_WITH_LAZY_HYDRATION_RE }
3160
3160
  },
3161
3161
  async handler(code, id) {
3162
- const scopeTracker = new ScopeTracker({ preserveExitedScopes: true });
3163
- for (const { 0: script } of code.matchAll(SCRIPT_RE$1)) {
3164
- if (!script) {
3165
- continue;
3166
- }
3167
- try {
3168
- parseAndWalk(script, id, {
3169
- scopeTracker
3170
- });
3171
- } catch {
3172
- }
3173
- }
3174
3162
  const { 0: template, index: offset = 0 } = code.match(TEMPLATE_RE) || {};
3175
- if (!template || !LAZY_HYDRATION_PROPS_RE.test(template)) {
3163
+ if (!template) {
3176
3164
  return;
3177
3165
  }
3178
- const s = new MagicString(code);
3179
3166
  try {
3180
3167
  const ast = parse(template);
3168
+ const scopeTracker = new ScopeTracker({ preserveExitedScopes: true });
3169
+ for (const { 0: script } of code.matchAll(SCRIPT_RE$1)) {
3170
+ if (!script) {
3171
+ continue;
3172
+ }
3173
+ try {
3174
+ parseAndWalk(script, id, { scopeTracker });
3175
+ } catch {
3176
+ }
3177
+ }
3178
+ const s = new MagicString(code);
3181
3179
  const components = new Set(options.getComponents().map((c) => c.pascalName));
3182
3180
  await walk$1(ast, (node) => {
3183
3181
  if (node.type !== 1) {
@@ -3222,14 +3220,14 @@ Rename it to \`<Lazy${pascalCase(node.name)} />\` or remove the lazy-hydration p
3222
3220
  }
3223
3221
  }
3224
3222
  });
3223
+ if (s.hasChanged()) {
3224
+ return {
3225
+ code: s.toString(),
3226
+ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
3227
+ };
3228
+ }
3225
3229
  } catch {
3226
3230
  }
3227
- if (s.hasChanged()) {
3228
- return {
3229
- code: s.toString(),
3230
- map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
3231
- };
3232
- }
3233
3231
  }
3234
3232
  }
3235
3233
  };
@@ -3818,7 +3816,7 @@ function addDeclarationTemplates(ctx, options) {
3818
3816
  });
3819
3817
  }
3820
3818
 
3821
- const version = "4.1.2-29293741.3f7624b3";
3819
+ const version = "4.1.2-29293755.13aef2ae";
3822
3820
 
3823
3821
  const createImportProtectionPatterns = (nuxt, options) => {
3824
3822
  const patterns = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-nightly",
3
- "version": "4.1.2-29293741.3f7624b3",
3
+ "version": "4.1.2-29293755.13aef2ae",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -67,10 +67,10 @@
67
67
  "@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
68
68
  "@nuxt/devalue": "^2.0.2",
69
69
  "@nuxt/devtools": "^2.6.3",
70
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.1.2-29293741.3f7624b3",
71
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.2-29293741.3f7624b3",
70
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.1.2-29293755.13aef2ae",
71
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.2-29293755.13aef2ae",
72
72
  "@nuxt/telemetry": "^2.6.6",
73
- "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.2-29293741.3f7624b3",
73
+ "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.2-29293755.13aef2ae",
74
74
  "@unhead/vue": "^2.0.14",
75
75
  "@vue/shared": "^3.5.21",
76
76
  "c12": "^3.2.0",