Skip to content

Commit

Permalink
fix(nuxt): remove dynamic nuxt-client within template code (#25464)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien committed Jan 27, 2024
1 parent a995f72 commit 1338414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/islandsTransform.ts
Expand Up @@ -32,7 +32,7 @@ interface ComponentChunkOptions {
const SCRIPT_RE = /<script[^>]*>/g
const HAS_SLOT_OR_CLIENT_RE = /(<slot[^>]*>)|(nuxt-client)/
const TEMPLATE_RE = /<template>([\s\S]*)<\/template>/
const NUXTCLIENT_ATTR_RE = /\snuxt-client(="[^"]*")?/g
const NUXTCLIENT_ATTR_RE = /\s:?nuxt-client(="[^"]*")?/g
const IMPORT_CODE = '\nimport { vforToArray as __vforToArray } from \'#app/components/utils\'' + '\nimport NuxtTeleportIslandComponent from \'#app/components/nuxt-teleport-island-component\'' + '\nimport NuxtTeleportSsrSlot from \'#app/components/nuxt-teleport-island-slot\''

function wrapWithVForDiv (code: string, vfor: string): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/test/islandTransform.test.ts
Expand Up @@ -277,7 +277,7 @@ describe('islandTransform - server and island components', () => {
"<template>
<div>
<HelloWorld />
<NuxtTeleportIslandComponent to="HelloWorld-eo0XycWCUV" :nuxt-client="nuxtClient"><HelloWorld :nuxt-client="nuxtClient" /></NuxtTeleportIslandComponent>
<NuxtTeleportIslandComponent to="HelloWorld-eo0XycWCUV" :nuxt-client="nuxtClient"><HelloWorld /></NuxtTeleportIslandComponent>
</div>
</template>
Expand Down

0 comments on commit 1338414

Please sign in to comment.