diff --git a/package.json b/package.json index 38c2286..f6749b3 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Universal HMR for SolidJS", "author": "Ryan Carniato", "license": "MIT", - "version": "0.7.8", + "version": "0.8.0-next.7", "homepage": "https://github.com/solidjs/solid-refresh#readme", "repository": { "type": "git", @@ -58,15 +58,15 @@ "@types/babel__core": "^7.20.5", "@types/babel__generator": "^7.27.0", "@types/node": "^25.3.0", - "babel-preset-solid": "^1.9.10", + "babel-preset-solid": "2.0.0-beta.7", "rollup": "^4.59.0", - "solid-js": "^1.9.11", + "solid-js": "2.0.0-beta.7", "tslib": "^2.6.2", "typescript": "^5.9.3", "vitest": "^4.0.18" }, "peerDependencies": { - "solid-js": "^1.3" + "solid-js": ">=2.0.0-beta.7 <2.0.0-experimental.0" }, "dependencies": { "@babel/generator": "^7.29.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adfafe6..287d539 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,14 +37,14 @@ importers: specifier: ^25.3.0 version: 25.3.0 babel-preset-solid: - specifier: ^1.9.10 - version: 1.9.10(@babel/core@7.29.0)(solid-js@1.9.11) + specifier: 2.0.0-beta.7 + version: 2.0.0-beta.7(@babel/core@7.29.0)(solid-js@2.0.0-beta.7) rollup: specifier: ^4.59.0 version: 4.59.0 solid-js: - specifier: ^1.9.11 - version: 1.9.11 + specifier: 2.0.0-beta.7 + version: 2.0.0-beta.7 tslib: specifier: ^2.6.2 version: 2.8.1 @@ -980,6 +980,9 @@ packages: cpu: [x64] os: [win32] + '@solidjs/signals@2.0.0-beta.7': + resolution: {integrity: sha512-SgK6oQlQZofz82LiEJ2RzT3sbs1lWTqFEtLoWjLsUo/dk1v9EoIFpJJlmvgkXvNugASWG+l1yOHa1a8lPamxug==} + '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} @@ -1125,16 +1128,16 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - babel-plugin-jsx-dom-expressions@0.40.5: - resolution: {integrity: sha512-8TFKemVLDYezqqv4mWz+PhRrkryTzivTGu0twyLrOkVZ0P63COx2Y04eVsUjFlwSOXui1z3P3Pn209dokWnirg==} + babel-plugin-jsx-dom-expressions@0.41.0-next.20: + resolution: {integrity: sha512-lx/CJGRTNhVv3jpC1zIz0qS0H3OUxCRxQFrgCzdvxwInimGjIJ62GodD3Ls4z31BmDCY/HzJkCjP0qKFslpkgg==} peerDependencies: '@babel/core': ^7.20.12 - babel-preset-solid@1.9.10: - resolution: {integrity: sha512-HCelrgua/Y+kqO8RyL04JBWS/cVdrtUv/h45GntgQY+cJl4eBcKkCDV3TdMjtKx1nXwRaR9QXslM/Npm1dxdZQ==} + babel-preset-solid@2.0.0-beta.7: + resolution: {integrity: sha512-+RVf63D5AO5Ed6nv1ceW4+QsRM6MDtYuAm4w53SefdS/+Po0XF7EW0UHnrcdhiJspU6yhbS1XoopdNK6hcGohA==} peerDependencies: '@babel/core': ^7.0.0 - solid-js: ^1.9.10 + solid-js: ^2.0.0-beta.7 peerDependenciesMeta: solid-js: optional: true @@ -1506,8 +1509,8 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - solid-js@1.9.11: - resolution: {integrity: sha512-WEJtcc5mkh/BnHA6Yrg4whlF8g6QwpmXXRg4P2ztPmcKeHHlH4+djYecBLhSpecZY2RRECXYUwIc/C2r3yzQ4Q==} + solid-js@2.0.0-beta.7: + resolution: {integrity: sha512-7JHs+BhLeZXoU+u9dG+eKnyxxfZyGpOuJEBbN/1XbHKO/WhxecdplOAurlg/YDllNWPhsbXqmLR1H2paqSu62g==} source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} @@ -1571,6 +1574,9 @@ packages: resolution: {integrity: sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==} engines: {node: '>= 4'} + validate-html-nesting@1.2.4: + resolution: {integrity: sha512-doQi7e8EJ2OWneSG1aZpJluS6A49aZM0+EICXWKm1i6WvqTLmq0tpUcImc4KTWG50mORO0C4YDBtOCSYvElftw==} + vite@7.3.1: resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2699,6 +2705,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.59.0': optional: true + '@solidjs/signals@2.0.0-beta.7': {} + '@standard-schema/spec@1.1.0': {} '@swc/core-darwin-arm64@1.15.13': @@ -2839,7 +2847,7 @@ snapshots: assertion-error@2.0.1: {} - babel-plugin-jsx-dom-expressions@0.40.5(@babel/core@7.29.0): + babel-plugin-jsx-dom-expressions@0.41.0-next.20(@babel/core@7.29.0): dependencies: '@babel/core': 7.29.0 '@babel/helper-module-imports': 7.18.6 @@ -2847,13 +2855,14 @@ snapshots: '@babel/types': 7.29.0 html-entities: 2.3.3 parse5: 7.3.0 + validate-html-nesting: 1.2.4 - babel-preset-solid@1.9.10(@babel/core@7.29.0)(solid-js@1.9.11): + babel-preset-solid@2.0.0-beta.7(@babel/core@7.29.0)(solid-js@2.0.0-beta.7): dependencies: '@babel/core': 7.29.0 - babel-plugin-jsx-dom-expressions: 0.40.5(@babel/core@7.29.0) + babel-plugin-jsx-dom-expressions: 0.41.0-next.20(@babel/core@7.29.0) optionalDependencies: - solid-js: 1.9.11 + solid-js: 2.0.0-beta.7 base-x@3.0.11: dependencies: @@ -3207,8 +3216,9 @@ snapshots: siginfo@2.0.0: {} - solid-js@1.9.11: + solid-js@2.0.0-beta.7: dependencies: + '@solidjs/signals': 2.0.0-beta.7 csstype: 3.2.3 seroval: 1.5.0 seroval-plugins: 1.5.0(seroval@1.5.0) @@ -3254,6 +3264,8 @@ snapshots: utility-types@3.11.0: {} + validate-html-nesting@1.2.4: {} + vite@7.3.1(@types/node@25.3.0)(lightningcss@1.31.1): dependencies: esbuild: 0.27.3 diff --git a/src/babel/core/constants.ts b/src/babel/core/constants.ts index 1bf965f..fcd107e 100644 --- a/src/babel/core/constants.ts +++ b/src/babel/core/constants.ts @@ -37,11 +37,11 @@ export const IMPORT_DECLINE: ImportDefinition = { export const IMPORT_SPECIFIERS: ImportIdentifierSpecifier[] = [ { type: 'render', - definition: { name: 'render', kind: 'named', source: 'solid-js/web' }, + definition: { name: 'render', kind: 'named', source: '@solidjs/web' }, }, { type: 'render', - definition: { name: 'hydrate', kind: 'named', source: 'solid-js/web' }, + definition: { name: 'hydrate', kind: 'named', source: '@solidjs/web' }, }, { type: 'createContext', diff --git a/src/babel/index.ts b/src/babel/index.ts index c627ee9..4769744 100644 --- a/src/babel/index.ts +++ b/src/babel/index.ts @@ -4,7 +4,6 @@ import path from 'path'; import { isComponentishName } from './core/checks'; import { IMPORT_COMPONENT, - IMPORT_CONTEXT, IMPORT_SPECIFIERS, } from './core/constants'; import { createRegistry } from './core/create-registry'; @@ -165,13 +164,13 @@ function wrapContext( if (statementPath) { const registry = createRegistry(state, statementPath); const hotName = t.stringLiteral(identifier.name); - const contextCall = getImportIdentifier( + const componentCall = getImportIdentifier( state, statementPath, - IMPORT_CONTEXT, + IMPORT_COMPONENT, ); - return t.callExpression(contextCall, [registry, hotName, context]); + return t.callExpression(componentCall, [registry, hotName, context]); } return context; } diff --git a/src/runtime/create-proxy.ts b/src/runtime/create-proxy.ts index f918d85..0a5d626 100644 --- a/src/runtime/create-proxy.ts +++ b/src/runtime/create-proxy.ts @@ -33,18 +33,22 @@ export default function createProxy, P>( ): (props: P) => JSX.Element { const refreshName = `[solid-refresh]${name}`; function HMRComp(props: P): JSX.Element { - const s = source(); + const s = untrack(source); if (!s || $DEVCOMP in s) { return createMemo( () => { const c = source(); if (c) { - return untrack(() => c(props)); + return (untrack as Function)( + () => c(props), + (c as any)[$DEVCOMP] && `<${name}>`, + ); } return undefined; }, { name: refreshName, + transparent: true, }, ) as unknown as JSX.Element; } @@ -62,10 +66,10 @@ export default function createProxy, P>( if (property === 'location' || property === 'name') { return (HMRComp as any)[property]; } - return source()[property as keyof C]; + return untrack(source)[property as keyof C]; }, set(_, property, value) { - source()[property as keyof C] = value; + untrack(source)[property as keyof C] = value; return true; }, }); diff --git a/src/runtime/index.ts b/src/runtime/index.ts index d21510f..ecdce49 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,4 +1,4 @@ -import type { Context, JSX } from 'solid-js'; +import type { JSX } from 'solid-js'; import { createSignal, DEV } from 'solid-js'; import type { ESMRuntimeType, StandardRuntimeType } from '../shared/types'; import createProxy from './create-proxy'; @@ -26,24 +26,13 @@ export interface ComponentRegistrationData

extends ComponentOptions { update: (action: () => (props: P) => JSX.Element) => void; } -// The registration data for the context -export interface ContextRegistrationData { - // A compile-time ID generated for the context, this is usually - // derived from the context's name - id: string; - // The context instance - context: Context; -} - export interface Registry { components: Map>; - contexts: Map>; } export function $$registry(): Registry { return { components: new Map(), - contexts: new Map(), }; } @@ -53,7 +42,12 @@ export function $$component

( component: (props: P) => JSX.Element, options: ComponentOptions = {}, ): (props: P) => JSX.Element { - const [comp, setComp] = createSignal(component, { internal: true }); + let current = component; + const [comp, setComp] = createSignal(() => current); + const update = (fn: () => (props: P) => JSX.Element) => { + current = fn(); + setComp(() => current); + }; const proxy = createProxy<(props: P) => JSX.Element, P>( comp, id, @@ -63,28 +57,24 @@ export function $$component

( id, component, proxy, - update: setComp, + update, ...options, }); return proxy; } -export function $$context( - registry: Registry, - id: string, - context: Context, -): Context { - registry.contexts.set(id, { - id, - context, - }); - return context; -} - function patchComponent

( oldData: ComponentRegistrationData

, newData: ComponentRegistrationData

, ) { + // Preserve context identity: contexts (createContext) are components in Solid 2.0 + // but useContext relies on a stable Symbol .id for lookups + const oldComp = oldData.component as any; + const newComp = newData.component as any; + if (oldComp.id != null && typeof oldComp.id === 'symbol') { + newComp.id = oldComp.id; + } + // Check if incoming module has signature if (newData.signature) { // Compare signatures @@ -136,46 +126,8 @@ function patchComponents(oldData: Registry, newData: Registry) { return false; } -function patchContext( - oldData: ContextRegistrationData, - newData: ContextRegistrationData, -) { - oldData.context.defaultValue = newData.context.defaultValue; - newData.context.id = oldData.context.id; - newData.context.Provider = oldData.context.Provider; -} - -function patchContexts(oldData: Registry, newData: Registry) { - const contexts = new Set([ - ...oldData.contexts.keys(), - ...newData.contexts.keys(), - ]); - for (const key of contexts) { - const oldContext = oldData.contexts.get(key); - const newContext = newData.contexts.get(key); - - if (oldContext) { - if (newContext) { - patchContext(oldContext, newContext); - } else { - // We need to invalidate - return true; - } - } else if (newContext) { - oldData.contexts.set(key, newContext); - } - } - return false; -} - function patchRegistry(oldRegistry: Registry, newRegistry: Registry) { - const shouldInvalidateByContext = patchContexts(oldRegistry, newRegistry); - const shouldInvalidateByComponents = patchComponents( - oldRegistry, - newRegistry, - ); - // In the future we may add other HMR features here - return shouldInvalidateByComponents || shouldInvalidateByContext; + return patchComponents(oldRegistry, newRegistry); } const SOLID_REFRESH = 'solid-refresh'; diff --git a/tests/client-hydratable/__snapshots__/esm.test.ts.snap b/tests/client-hydratable/__snapshots__/esm.test.ts.snap index 6ca7987..4d1b5d1 100644 --- a/tests/client-hydratable/__snapshots__/esm.test.ts.snap +++ b/tests/client-hydratable/__snapshots__/esm.test.ts.snap @@ -8,32 +8,32 @@ if (someCond) { `; exports[`esm (client, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (client, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -46,8 +46,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -56,9 +56,9 @@ export default function Foo() { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -77,9 +77,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -98,9 +98,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -123,9 +123,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -148,10 +148,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -184,7 +184,7 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -216,9 +216,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -260,8 +260,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -274,8 +274,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -284,9 +284,9 @@ export function Foo() { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -309,9 +309,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -330,9 +330,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -355,9 +355,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -380,10 +380,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -416,7 +416,7 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -448,9 +448,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -493,8 +493,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -507,8 +507,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -517,9 +517,9 @@ function Foo() { `; exports[`esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -538,9 +538,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -559,9 +559,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -583,9 +583,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -607,10 +607,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -642,7 +642,7 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -673,9 +673,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -716,8 +716,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -730,8 +730,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -740,9 +740,9 @@ const Foo = () => { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -761,9 +761,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -782,9 +782,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -806,9 +806,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -830,10 +830,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -865,7 +865,7 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -896,9 +896,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -939,8 +939,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -953,8 +953,8 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -963,9 +963,9 @@ const Foo = function () { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -984,9 +984,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1005,9 +1005,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1029,9 +1029,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1053,10 +1053,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1088,7 +1088,7 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1119,9 +1119,9 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1162,10 +1162,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1174,7 +1174,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1195,10 +1195,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1207,7 +1207,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1234,10 +1234,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1247,7 +1247,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1275,10 +1275,10 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1289,11 +1289,11 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1309,11 +1309,11 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1329,11 +1329,11 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1349,11 +1349,11 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1369,11 +1369,11 @@ if (import.meta.hot) { `; exports[`esm (client, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client-hydratable/__snapshots__/rspack-esm.test.ts.snap b/tests/client-hydratable/__snapshots__/rspack-esm.test.ts.snap index b57cc4e..b06e426 100644 --- a/tests/client-hydratable/__snapshots__/rspack-esm.test.ts.snap +++ b/tests/client-hydratable/__snapshots__/rspack-esm.test.ts.snap @@ -8,32 +8,32 @@ if (someCond) { `; exports[`rspack-esm (client, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (client, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -46,8 +46,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -56,9 +56,9 @@ export default function Foo() { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -77,9 +77,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -98,9 +98,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -123,9 +123,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -148,10 +148,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -184,7 +184,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -216,9 +216,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -260,8 +260,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -274,8 +274,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -284,9 +284,9 @@ export function Foo() { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -309,9 +309,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -330,9 +330,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -355,9 +355,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -380,10 +380,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -416,7 +416,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -448,9 +448,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -493,8 +493,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -507,8 +507,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -517,9 +517,9 @@ function Foo() { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -538,9 +538,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -559,9 +559,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -583,9 +583,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -607,10 +607,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -642,7 +642,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -673,9 +673,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -716,8 +716,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -730,8 +730,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -740,9 +740,9 @@ const Foo = () => { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -761,9 +761,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -782,9 +782,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -806,9 +806,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -830,10 +830,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -865,7 +865,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -896,9 +896,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -939,8 +939,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -953,8 +953,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -963,9 +963,9 @@ const Foo = function () { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -984,9 +984,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1005,9 +1005,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1029,9 +1029,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1053,10 +1053,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1088,7 +1088,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1119,9 +1119,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1162,10 +1162,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1174,7 +1174,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1195,10 +1195,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1207,7 +1207,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1234,10 +1234,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1247,7 +1247,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1275,10 +1275,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1289,11 +1289,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1309,11 +1309,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1329,11 +1329,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1349,11 +1349,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1369,11 +1369,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client-hydratable/__snapshots__/standard.test.ts.snap b/tests/client-hydratable/__snapshots__/standard.test.ts.snap index 1ee8753..981d6e0 100644 --- a/tests/client-hydratable/__snapshots__/standard.test.ts.snap +++ b/tests/client-hydratable/__snapshots__/standard.test.ts.snap @@ -8,32 +8,32 @@ if (someCond) { `; exports[`standard (client, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (client, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -46,8 +46,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -56,9 +56,9 @@ export default function Foo() { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -77,9 +77,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -98,9 +98,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -123,9 +123,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -148,10 +148,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -184,7 +184,7 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -216,9 +216,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -260,8 +260,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -274,8 +274,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -284,9 +284,9 @@ export function Foo() { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -309,9 +309,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -330,9 +330,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -355,9 +355,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -380,10 +380,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -416,7 +416,7 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -448,9 +448,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -493,8 +493,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -507,8 +507,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -517,9 +517,9 @@ function Foo() { `; exports[`standard (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -538,9 +538,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -559,9 +559,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -583,9 +583,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -607,10 +607,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -642,7 +642,7 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -673,9 +673,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -716,8 +716,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -730,8 +730,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -740,9 +740,9 @@ const Foo = () => { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -761,9 +761,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -782,9 +782,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -806,9 +806,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -830,10 +830,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -865,7 +865,7 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -896,9 +896,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -939,8 +939,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -953,8 +953,8 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -963,9 +963,9 @@ const Foo = function () { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -984,9 +984,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1005,9 +1005,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1029,9 +1029,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1053,10 +1053,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1088,7 +1088,7 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1119,9 +1119,9 @@ if (module.hot) { `; exports[`standard (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1162,10 +1162,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1174,7 +1174,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1195,10 +1195,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1207,7 +1207,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1234,10 +1234,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1247,7 +1247,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1275,10 +1275,10 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (module.hot) module.hot.dispose(_cleanup); @@ -1289,11 +1289,11 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1309,11 +1309,11 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1329,11 +1329,11 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1349,11 +1349,11 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1369,11 +1369,11 @@ if (module.hot) { `; exports[`standard (client, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client-hydratable/__snapshots__/vite.test.ts.snap b/tests/client-hydratable/__snapshots__/vite.test.ts.snap index 8f57e26..a2cb9d7 100644 --- a/tests/client-hydratable/__snapshots__/vite.test.ts.snap +++ b/tests/client-hydratable/__snapshots__/vite.test.ts.snap @@ -8,12 +8,12 @@ if (someCond) { `; exports[`vite (client, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -21,12 +21,12 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -34,8 +34,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload export default function Foo() { @@ -47,8 +47,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -57,9 +57,9 @@ export default function Foo() { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -79,9 +79,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -101,9 +101,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -127,9 +127,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -153,10 +153,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -190,7 +190,7 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -223,9 +223,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -268,8 +268,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload export function Foo() { @@ -281,8 +281,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -291,9 +291,9 @@ export function Foo() { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -317,9 +317,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -339,9 +339,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -365,9 +365,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -391,10 +391,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -428,7 +428,7 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -461,9 +461,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -507,8 +507,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload function Foo() { @@ -520,8 +520,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -530,9 +530,9 @@ function Foo() { `; exports[`vite (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -552,9 +552,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -574,9 +574,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -599,9 +599,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -624,10 +624,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -660,7 +660,7 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -692,9 +692,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -736,8 +736,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload const Foo = () => { @@ -749,8 +749,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -759,9 +759,9 @@ const Foo = () => { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -781,9 +781,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -803,9 +803,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -828,9 +828,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -853,10 +853,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -889,7 +889,7 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -921,9 +921,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -965,8 +965,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload const Foo = function () { @@ -978,8 +978,8 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -988,9 +988,9 @@ const Foo = function () { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1010,9 +1010,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1032,9 +1032,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1057,9 +1057,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1082,10 +1082,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1118,7 +1118,7 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1150,9 +1150,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1194,10 +1194,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1206,7 +1206,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1228,10 +1228,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1240,7 +1240,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1268,10 +1268,10 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1281,7 +1281,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1310,9 +1310,9 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1323,11 +1323,11 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1344,11 +1344,11 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1365,11 +1365,11 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1386,11 +1386,11 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1407,11 +1407,11 @@ if (import.meta.hot) { `; exports[`vite (client, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client-hydratable/__snapshots__/webpack5.test.ts.snap b/tests/client-hydratable/__snapshots__/webpack5.test.ts.snap index 17687d3..21c8b63 100644 --- a/tests/client-hydratable/__snapshots__/webpack5.test.ts.snap +++ b/tests/client-hydratable/__snapshots__/webpack5.test.ts.snap @@ -8,32 +8,32 @@ if (someCond) { `; exports[`webpack5 (client, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (client, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -46,8 +46,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -56,9 +56,9 @@ export default function Foo() { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -77,9 +77,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -98,9 +98,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -123,9 +123,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -148,10 +148,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -184,7 +184,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -216,9 +216,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -260,8 +260,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -274,8 +274,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -284,9 +284,9 @@ export function Foo() { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -309,9 +309,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -330,9 +330,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -355,9 +355,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -380,10 +380,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -416,7 +416,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -448,9 +448,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -493,8 +493,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -507,8 +507,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -517,9 +517,9 @@ function Foo() { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -538,9 +538,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -559,9 +559,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -583,9 +583,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -607,10 +607,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -642,7 +642,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -673,9 +673,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -716,8 +716,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -730,8 +730,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -740,9 +740,9 @@ const Foo = () => { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -761,9 +761,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -782,9 +782,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -806,9 +806,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -830,10 +830,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -865,7 +865,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -896,9 +896,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -939,8 +939,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -953,8 +953,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -963,9 +963,9 @@ const Foo = function () { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -984,9 +984,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1005,9 +1005,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1029,9 +1029,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1053,10 +1053,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1088,7 +1088,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1119,9 +1119,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1162,10 +1162,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1174,7 +1174,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1195,10 +1195,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1207,7 +1207,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1234,10 +1234,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { getNextElement as _$getNextElement } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { getNextElement as _$getNextElement } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1247,7 +1247,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _$getNextElement(_tmpl$); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1275,10 +1275,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1289,11 +1289,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1309,11 +1309,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1329,11 +1329,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1349,11 +1349,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1369,11 +1369,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client-hydratable/esm.test.ts b/tests/client-hydratable/esm.test.ts index b2b9240..eadbd7e 100644 --- a/tests/client-hydratable/esm.test.ts +++ b/tests/client-hydratable/esm.test.ts @@ -719,7 +719,7 @@ describe('esm (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('esm (client, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('esm (client, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('esm (client, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('esm (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('esm (client, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client-hydratable/rspack-esm.test.ts b/tests/client-hydratable/rspack-esm.test.ts index a265e1c..0a31ac7 100644 --- a/tests/client-hydratable/rspack-esm.test.ts +++ b/tests/client-hydratable/rspack-esm.test.ts @@ -719,7 +719,7 @@ describe('rspack-esm (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('rspack-esm (client, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('rspack-esm (client, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('rspack-esm (client, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('rspack-esm (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('rspack-esm (client, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client-hydratable/standard.test.ts b/tests/client-hydratable/standard.test.ts index b03423c..eed1a7b 100644 --- a/tests/client-hydratable/standard.test.ts +++ b/tests/client-hydratable/standard.test.ts @@ -719,7 +719,7 @@ describe('standard (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('standard (client, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('standard (client, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('standard (client, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('standard (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('standard (client, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client-hydratable/vite.test.ts b/tests/client-hydratable/vite.test.ts index 5de1ca1..c4ac9c1 100644 --- a/tests/client-hydratable/vite.test.ts +++ b/tests/client-hydratable/vite.test.ts @@ -719,7 +719,7 @@ describe('vite (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('vite (client, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('vite (client, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('vite (client, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('vite (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('vite (client, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client-hydratable/webpack5.test.ts b/tests/client-hydratable/webpack5.test.ts index 1286338..530f518 100644 --- a/tests/client-hydratable/webpack5.test.ts +++ b/tests/client-hydratable/webpack5.test.ts @@ -719,7 +719,7 @@ describe('webpack5 (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('webpack5 (client, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('webpack5 (client, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('webpack5 (client, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('webpack5 (client, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('webpack5 (client, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client/__snapshots__/esm.test.ts.snap b/tests/client/__snapshots__/esm.test.ts.snap index 826ba4b..4fa2750 100644 --- a/tests/client/__snapshots__/esm.test.ts.snap +++ b/tests/client/__snapshots__/esm.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`esm (client, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (client, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,9 +142,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -177,7 +177,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -209,8 +209,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -252,7 +252,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -265,7 +265,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -274,8 +274,8 @@ export function Foo() { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -298,8 +298,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -318,8 +318,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -342,8 +342,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -366,9 +366,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -401,7 +401,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -433,8 +433,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -477,7 +477,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -490,7 +490,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -499,8 +499,8 @@ function Foo() { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -519,8 +519,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -539,8 +539,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -562,8 +562,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -585,9 +585,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -619,7 +619,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -650,8 +650,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -692,7 +692,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -705,7 +705,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -714,8 +714,8 @@ const Foo = () => { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -734,8 +734,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -754,8 +754,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -777,8 +777,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -800,9 +800,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -834,7 +834,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -865,8 +865,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -907,7 +907,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -920,7 +920,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -929,8 +929,8 @@ const Foo = function () { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -949,8 +949,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -969,8 +969,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -992,8 +992,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1015,9 +1015,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1049,7 +1049,7 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1080,8 +1080,8 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1122,9 +1122,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1133,7 +1133,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1154,9 +1154,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1165,7 +1165,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1192,9 +1192,9 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1204,7 +1204,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1232,10 +1232,10 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1246,11 +1246,11 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1266,11 +1266,11 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1286,11 +1286,11 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1306,11 +1306,11 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1326,11 +1326,11 @@ if (import.meta.hot) { `; exports[`esm (client, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client/__snapshots__/rspack-esm.test.ts.snap b/tests/client/__snapshots__/rspack-esm.test.ts.snap index e44e7f2..93df840 100644 --- a/tests/client/__snapshots__/rspack-esm.test.ts.snap +++ b/tests/client/__snapshots__/rspack-esm.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`rspack-esm (client, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (client, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,9 +142,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -177,7 +177,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -209,8 +209,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -252,7 +252,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -265,7 +265,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -274,8 +274,8 @@ export function Foo() { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -298,8 +298,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -318,8 +318,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -342,8 +342,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -366,9 +366,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -401,7 +401,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -433,8 +433,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -477,7 +477,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -490,7 +490,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -499,8 +499,8 @@ function Foo() { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -519,8 +519,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -539,8 +539,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -562,8 +562,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -585,9 +585,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -619,7 +619,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -650,8 +650,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -692,7 +692,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -705,7 +705,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -714,8 +714,8 @@ const Foo = () => { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -734,8 +734,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -754,8 +754,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -777,8 +777,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -800,9 +800,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -834,7 +834,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -865,8 +865,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -907,7 +907,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -920,7 +920,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -929,8 +929,8 @@ const Foo = function () { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -949,8 +949,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -969,8 +969,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -992,8 +992,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1015,9 +1015,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1049,7 +1049,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1080,8 +1080,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1122,9 +1122,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1133,7 +1133,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1154,9 +1154,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1165,7 +1165,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1192,9 +1192,9 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1204,7 +1204,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1232,10 +1232,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1246,11 +1246,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1266,11 +1266,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1286,11 +1286,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1306,11 +1306,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1326,11 +1326,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (client, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client/__snapshots__/standard.test.ts.snap b/tests/client/__snapshots__/standard.test.ts.snap index 480d636..8e894bd 100644 --- a/tests/client/__snapshots__/standard.test.ts.snap +++ b/tests/client/__snapshots__/standard.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`standard (client, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (client, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,9 +142,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -177,7 +177,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -209,8 +209,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -252,7 +252,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -265,7 +265,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -274,8 +274,8 @@ export function Foo() { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -298,8 +298,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -318,8 +318,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -342,8 +342,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -366,9 +366,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -401,7 +401,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -433,8 +433,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -477,7 +477,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -490,7 +490,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -499,8 +499,8 @@ function Foo() { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -519,8 +519,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -539,8 +539,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -562,8 +562,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -585,9 +585,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -619,7 +619,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -650,8 +650,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -692,7 +692,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -705,7 +705,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -714,8 +714,8 @@ const Foo = () => { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -734,8 +734,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -754,8 +754,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -777,8 +777,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -800,9 +800,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -834,7 +834,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -865,8 +865,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -907,7 +907,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -920,7 +920,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -929,8 +929,8 @@ const Foo = function () { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -949,8 +949,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -969,8 +969,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -992,8 +992,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1015,9 +1015,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1049,7 +1049,7 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1080,8 +1080,8 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1122,9 +1122,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1133,7 +1133,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1154,9 +1154,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1165,7 +1165,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1192,9 +1192,9 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1204,7 +1204,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1232,10 +1232,10 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (module.hot) module.hot.dispose(_cleanup); @@ -1246,11 +1246,11 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1266,11 +1266,11 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1286,11 +1286,11 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1306,11 +1306,11 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1326,11 +1326,11 @@ if (module.hot) { `; exports[`standard (client, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client/__snapshots__/vite.test.ts.snap b/tests/client/__snapshots__/vite.test.ts.snap index 74dab89..cb31b0d 100644 --- a/tests/client/__snapshots__/vite.test.ts.snap +++ b/tests/client/__snapshots__/vite.test.ts.snap @@ -8,12 +8,12 @@ if (someCond) { `; exports[`vite (client, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -21,12 +21,12 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -34,7 +34,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload export default function Foo() { @@ -46,7 +46,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -55,8 +55,8 @@ export default function Foo() { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -76,8 +76,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -97,8 +97,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -122,8 +122,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -147,9 +147,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -183,7 +183,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -216,8 +216,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -260,7 +260,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload export function Foo() { @@ -272,7 +272,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -281,8 +281,8 @@ export function Foo() { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -306,8 +306,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -327,8 +327,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -352,8 +352,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -377,9 +377,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -413,7 +413,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -446,8 +446,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -491,7 +491,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload function Foo() { @@ -503,7 +503,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -512,8 +512,8 @@ function Foo() { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -533,8 +533,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -554,8 +554,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -578,8 +578,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -602,9 +602,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -637,7 +637,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -669,8 +669,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -712,7 +712,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload const Foo = () => { @@ -724,7 +724,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -733,8 +733,8 @@ const Foo = () => { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -754,8 +754,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -775,8 +775,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -799,8 +799,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -823,9 +823,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -858,7 +858,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -890,8 +890,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -933,7 +933,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh reload const Foo = function () { @@ -945,7 +945,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -954,8 +954,8 @@ const Foo = function () { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -975,8 +975,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -996,8 +996,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1020,8 +1020,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1044,9 +1044,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1079,7 +1079,7 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1111,8 +1111,8 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1154,9 +1154,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1165,7 +1165,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1187,9 +1187,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1198,7 +1198,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1226,9 +1226,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1238,7 +1238,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1267,9 +1267,9 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1280,11 +1280,11 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1301,11 +1301,11 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1322,11 +1322,11 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1343,11 +1343,11 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1364,11 +1364,11 @@ if (import.meta.hot) { `; exports[`vite (client, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client/__snapshots__/webpack5.test.ts.snap b/tests/client/__snapshots__/webpack5.test.ts.snap index 45420d3..d6909f1 100644 --- a/tests/client/__snapshots__/webpack5.test.ts.snap +++ b/tests/client/__snapshots__/webpack5.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`webpack5 (client, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (client, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,9 +142,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -177,7 +177,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -209,8 +209,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -252,7 +252,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -265,7 +265,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip export function Foo() { @@ -274,8 +274,8 @@ export function Foo() { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -298,8 +298,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -318,8 +318,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -342,8 +342,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -366,9 +366,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -401,7 +401,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -433,8 +433,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -477,7 +477,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -490,7 +490,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip function Foo() { @@ -499,8 +499,8 @@ function Foo() { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -519,8 +519,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -539,8 +539,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -562,8 +562,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -585,9 +585,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -619,7 +619,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -650,8 +650,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
foo\`), _tmpl$2 = /*#__PURE__*/_$template(\`
bar\`); import { $$component as _$$component } from "solid-refresh"; @@ -692,7 +692,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -705,7 +705,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = () => { @@ -714,8 +714,8 @@ const Foo = () => { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -734,8 +734,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -754,8 +754,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -777,8 +777,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -800,9 +800,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -834,7 +834,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -865,8 +865,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -907,7 +907,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -920,7 +920,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { template as _$template } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); // @refresh skip const Foo = function () { @@ -929,8 +929,8 @@ const Foo = function () { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -949,8 +949,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -969,8 +969,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -992,8 +992,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

Foo\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1015,9 +1015,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { insert as _$insert } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { insert as _$insert } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`

\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1049,7 +1049,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1080,8 +1080,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
bar\`), _tmpl$2 = /*#__PURE__*/_$template(\`
foo\`); import { $$component as _$$component } from "solid-refresh"; @@ -1122,9 +1122,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1133,7 +1133,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1154,9 +1154,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1165,7 +1165,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:4:19", @@ -1192,9 +1192,9 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { template as _$template } from "solid-js/web"; -import { createComponent as _$createComponent } from "solid-js/web"; -import { use as _$use } from "solid-js/web"; +"import { template as _$template } from "@solidjs/web"; +import { createComponent as _$createComponent } from "@solidjs/web"; +import { ref as _$ref } from "@solidjs/web"; var _tmpl$ = /*#__PURE__*/_$template(\`
Comp\`); import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1204,7 +1204,7 @@ const _REGISTRY = _$$registry(); const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { var _el$ = _tmpl$(); var _ref$ = _props.v0; - typeof _ref$ === "function" ? _$use(_ref$, _el$) : _props.v0 = _el$; + typeof _ref$ === "function" || Array.isArray(_ref$) ? _$ref(() => _ref$, _el$) : _props.v0 = _el$; return _el$; })(), { location: "example.jsx:6:19", @@ -1232,10 +1232,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1246,11 +1246,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1266,11 +1266,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1286,11 +1286,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1306,11 +1306,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1326,11 +1326,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (client, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/client/esm.test.ts b/tests/client/esm.test.ts index c6a38ef..72336f1 100644 --- a/tests/client/esm.test.ts +++ b/tests/client/esm.test.ts @@ -719,7 +719,7 @@ describe('esm (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('esm (client, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('esm (client, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('esm (client, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('esm (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('esm (client, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client/rspack-esm.test.ts b/tests/client/rspack-esm.test.ts index ead438c..9a18c50 100644 --- a/tests/client/rspack-esm.test.ts +++ b/tests/client/rspack-esm.test.ts @@ -719,7 +719,7 @@ describe('rspack-esm (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('rspack-esm (client, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('rspack-esm (client, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('rspack-esm (client, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('rspack-esm (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('rspack-esm (client, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client/standard.test.ts b/tests/client/standard.test.ts index f076189..e046d94 100644 --- a/tests/client/standard.test.ts +++ b/tests/client/standard.test.ts @@ -719,7 +719,7 @@ describe('standard (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('standard (client, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('standard (client, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('standard (client, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('standard (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('standard (client, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client/vite.test.ts b/tests/client/vite.test.ts index e581070..b934d1c 100644 --- a/tests/client/vite.test.ts +++ b/tests/client/vite.test.ts @@ -719,7 +719,7 @@ describe('vite (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('vite (client, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('vite (client, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('vite (client, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('vite (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('vite (client, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/client/webpack5.test.ts b/tests/client/webpack5.test.ts index 29cde94..dbcae04 100644 --- a/tests/client/webpack5.test.ts +++ b/tests/client/webpack5.test.ts @@ -719,7 +719,7 @@ describe('webpack5 (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('webpack5 (client, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('webpack5 (client, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('webpack5 (client, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('webpack5 (client, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('webpack5 (client, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server-hydratable/__snapshots__/esm.test.ts.snap b/tests/server-hydratable/__snapshots__/esm.test.ts.snap index 82ec9ae..5898611 100644 --- a/tests/server-hydratable/__snapshots__/esm.test.ts.snap +++ b/tests/server-hydratable/__snapshots__/esm.test.ts.snap @@ -8,37 +8,40 @@ if (someCond) { `; exports[`esm (server, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -46,25 +49,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -77,15 +86,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -98,15 +110,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -123,15 +138,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -148,16 +166,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -180,7 +203,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -212,16 +235,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo
"], _tmpl$2 = ["bar
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -239,7 +265,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:21", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -256,13 +285,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -270,25 +302,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -305,15 +343,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -326,15 +367,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -351,15 +395,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -376,16 +423,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -408,7 +460,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -440,16 +492,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar
"], _tmpl$2 = ["foo
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "61dd3182" }); @@ -459,7 +514,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function Bar() { location: "example.jsx:2:13", signature: "e93ca257" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -485,13 +543,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -499,25 +560,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -530,15 +597,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -551,15 +621,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -575,15 +648,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -599,16 +675,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -630,7 +711,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -661,16 +742,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo
"], _tmpl$2 = ["bar
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -688,7 +772,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:6", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -704,13 +791,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -718,25 +808,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -749,15 +845,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -770,15 +869,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -794,15 +896,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -818,17 +923,22 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -849,7 +959,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -880,16 +990,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar
"], _tmpl$2 = ["foo
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -899,7 +1012,10 @@ const Bar = _$$component(_REGISTRY, "Bar", () => { location: "example.jsx:2:20", signature: "d1c6ca9b" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -923,13 +1039,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -937,25 +1056,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -968,15 +1093,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -989,15 +1117,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1013,15 +1144,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1037,17 +1171,22 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1068,7 +1207,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1099,16 +1238,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar
"], _tmpl$2 = ["foo
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -1118,7 +1260,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function () { location: "example.jsx:2:20", signature: "1fb34faa" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -1142,15 +1287,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1169,15 +1318,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1202,16 +1355,20 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1237,10 +1394,10 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1251,11 +1408,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1271,11 +1428,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1291,11 +1448,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1311,11 +1468,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1331,11 +1488,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server-hydratable/__snapshots__/rspack-esm.test.ts.snap b/tests/server-hydratable/__snapshots__/rspack-esm.test.ts.snap index c340374..b1da04e 100644 --- a/tests/server-hydratable/__snapshots__/rspack-esm.test.ts.snap +++ b/tests/server-hydratable/__snapshots__/rspack-esm.test.ts.snap @@ -8,37 +8,40 @@ if (someCond) { `; exports[`esm (server, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -46,25 +49,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -77,15 +86,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -98,15 +110,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -123,15 +138,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -148,16 +166,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -180,7 +203,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -212,16 +235,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo
"], _tmpl$2 = ["bar
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -239,7 +265,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:21", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -256,13 +285,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -270,25 +302,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; // @refresh skip export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -305,15 +343,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -326,15 +367,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -351,15 +395,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -376,16 +423,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -408,7 +460,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -440,16 +492,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar
"], _tmpl$2 = ["foo
"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "61dd3182" }); @@ -459,7 +514,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function Bar() { location: "example.jsx:2:13", signature: "e93ca257" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -485,13 +543,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo

"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -499,25 +560,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -530,15 +597,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -551,15 +621,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -575,15 +648,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -599,16 +675,21 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -630,7 +711,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -661,16 +742,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -688,7 +772,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:6", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -704,13 +791,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -718,25 +808,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -749,15 +845,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -770,15 +869,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -794,15 +896,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -818,17 +923,22 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -849,7 +959,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -880,16 +990,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -899,7 +1012,10 @@ const Bar = _$$component(_REGISTRY, "Bar", () => { location: "example.jsx:2:20", signature: "d1c6ca9b" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -923,13 +1039,16 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { _$$decline("esm", import.meta.hot); @@ -937,25 +1056,31 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -968,15 +1093,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -989,15 +1117,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1013,15 +1144,18 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1037,17 +1171,22 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1068,7 +1207,7 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1099,16 +1238,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -1118,7 +1260,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function () { location: "example.jsx:2:20", signature: "1fb34faa" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -1142,15 +1287,19 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1169,15 +1318,19 @@ if (import.meta.webpackHot) { `; exports[`esm (server, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1202,16 +1355,20 @@ if (import.meta.webpackHot) { `; exports[`esm (server, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1237,10 +1394,10 @@ if (import.meta.webpackHot) { `; exports[`esm (server, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1251,11 +1408,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1271,11 +1428,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1291,11 +1448,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1311,11 +1468,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1331,11 +1488,11 @@ if (import.meta.hot) { `; exports[`esm (server, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server-hydratable/__snapshots__/standard.test.ts.snap b/tests/server-hydratable/__snapshots__/standard.test.ts.snap index d537390..190e3f6 100644 --- a/tests/server-hydratable/__snapshots__/standard.test.ts.snap +++ b/tests/server-hydratable/__snapshots__/standard.test.ts.snap @@ -8,37 +8,40 @@ if (someCond) { `; exports[`standard (server, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (server, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (module.hot) { _$$decline("standard", module.hot); @@ -46,25 +49,31 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -77,15 +86,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -98,15 +110,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -123,15 +138,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -148,16 +166,21 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -180,7 +203,7 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -212,16 +235,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -239,7 +265,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:21", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -256,13 +285,16 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (module.hot) { _$$decline("standard", module.hot); @@ -270,25 +302,31 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -305,15 +343,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -326,15 +367,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -351,15 +395,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -376,16 +423,21 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -408,7 +460,7 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -440,16 +492,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "61dd3182" }); @@ -459,7 +514,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function Bar() { location: "example.jsx:2:13", signature: "e93ca257" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -485,13 +543,16 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (module.hot) { _$$decline("standard", module.hot); @@ -499,25 +560,31 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`standard (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -530,15 +597,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -551,15 +621,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -575,15 +648,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -599,16 +675,21 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -630,7 +711,7 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -661,16 +742,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -688,7 +772,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:6", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -704,13 +791,16 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (module.hot) { _$$decline("standard", module.hot); @@ -718,25 +808,31 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -749,15 +845,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -770,15 +869,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -794,15 +896,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -818,17 +923,22 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -849,7 +959,7 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -880,16 +990,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -899,7 +1012,10 @@ const Bar = _$$component(_REGISTRY, "Bar", () => { location: "example.jsx:2:20", signature: "d1c6ca9b" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -923,13 +1039,16 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (module.hot) { _$$decline("standard", module.hot); @@ -937,25 +1056,31 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -968,15 +1093,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -989,15 +1117,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1013,15 +1144,18 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1037,17 +1171,22 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1068,7 +1207,7 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1099,16 +1238,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -1118,7 +1260,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function () { location: "example.jsx:2:20", signature: "1fb34faa" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -1142,15 +1287,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1169,15 +1318,19 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1202,16 +1355,20 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1237,10 +1394,10 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (module.hot) module.hot.dispose(_cleanup); @@ -1251,11 +1408,11 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1271,11 +1428,11 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1291,11 +1448,11 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1311,11 +1468,11 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1331,11 +1488,11 @@ if (module.hot) { `; exports[`standard (server, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server-hydratable/__snapshots__/vite.test.ts.snap b/tests/server-hydratable/__snapshots__/vite.test.ts.snap index 1620475..905fe31 100644 --- a/tests/server-hydratable/__snapshots__/vite.test.ts.snap +++ b/tests/server-hydratable/__snapshots__/vite.test.ts.snap @@ -8,12 +8,12 @@ if (someCond) { `; exports[`vite (server, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -21,12 +21,12 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -34,12 +34,15 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh reload export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { import.meta.hot.accept(() => import.meta.hot.invalidate()); @@ -47,25 +50,31 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -79,15 +88,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -101,15 +113,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -127,15 +142,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -153,16 +171,21 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -186,7 +209,7 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -219,16 +242,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -246,7 +272,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:21", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -264,12 +293,15 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh reload export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { import.meta.hot.accept(() => import.meta.hot.invalidate()); @@ -277,25 +309,31 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -313,15 +351,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -335,15 +376,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -361,15 +405,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -387,16 +434,21 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -420,7 +472,7 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -453,16 +505,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "61dd3182" }); @@ -472,7 +527,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function Bar() { location: "example.jsx:2:13", signature: "e93ca257" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -499,12 +557,15 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh reload function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.hot) { import.meta.hot.accept(() => import.meta.hot.invalidate()); @@ -512,25 +573,31 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`vite (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -544,15 +611,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -566,15 +636,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -591,15 +664,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -616,16 +692,21 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -648,7 +729,7 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -680,16 +761,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -707,7 +791,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:6", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -724,12 +811,15 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh reload const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { import.meta.hot.accept(() => import.meta.hot.invalidate()); @@ -737,25 +827,31 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -769,15 +865,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -791,15 +890,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -816,15 +918,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -841,17 +946,22 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -873,7 +983,7 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -905,16 +1015,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -924,7 +1037,10 @@ const Bar = _$$component(_REGISTRY, "Bar", () => { location: "example.jsx:2:20", signature: "d1c6ca9b" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -949,12 +1065,15 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh reload const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.hot) { import.meta.hot.accept(() => import.meta.hot.invalidate()); @@ -962,25 +1081,31 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -994,15 +1119,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1016,15 +1144,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1041,15 +1172,18 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1066,17 +1200,22 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1098,7 +1237,7 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1130,16 +1269,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -1149,7 +1291,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function () { location: "example.jsx:2:20", signature: "1fb34faa" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -1174,15 +1319,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1202,15 +1351,19 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1236,16 +1389,20 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1272,9 +1429,9 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1285,11 +1442,11 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1306,11 +1463,11 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1327,11 +1484,11 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1348,11 +1505,11 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1369,11 +1526,11 @@ if (import.meta.hot) { `; exports[`vite (server, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server-hydratable/__snapshots__/webpack5.test.ts.snap b/tests/server-hydratable/__snapshots__/webpack5.test.ts.snap index a826640..94b9e7a 100644 --- a/tests/server-hydratable/__snapshots__/webpack5.test.ts.snap +++ b/tests/server-hydratable/__snapshots__/webpack5.test.ts.snap @@ -8,37 +8,40 @@ if (someCond) { `; exports[`webpack5 (server, hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (server, hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.webpackHot) { _$$decline("webpack5", import.meta.webpackHot); @@ -46,25 +49,31 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export default function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -77,15 +86,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -98,15 +110,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -123,15 +138,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -148,16 +166,21 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -180,7 +203,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -212,16 +235,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -239,7 +265,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:21", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -256,13 +285,16 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.webpackHot) { _$$decline("webpack5", import.meta.webpackHot); @@ -270,25 +302,31 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip export function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -305,15 +343,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -326,15 +367,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -351,15 +395,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -376,16 +423,21 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -408,7 +460,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -440,16 +492,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "61dd3182" }); @@ -459,7 +514,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function Bar() { location: "example.jsx:2:13", signature: "e93ca257" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -485,13 +543,16 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); } if (import.meta.webpackHot) { _$$decline("webpack5", import.meta.webpackHot); @@ -499,25 +560,31 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip function Foo() { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }" `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -530,15 +597,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -551,15 +621,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -575,15 +648,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:15", signature: "4b145a58" }); @@ -599,16 +675,21 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -630,7 +711,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -661,16 +742,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["foo"], _tmpl$2 = ["bar"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:8:12", signature: "241c14a4" }); @@ -688,7 +772,10 @@ const Foo = _$$component(_REGISTRY, "Foo", function Foo() { location: "example.jsx:5:6", signature: "c963b907" }); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props2 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:3:15", signature: "fad4daa8" }); @@ -704,13 +791,16 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.webpackHot) { _$$decline("webpack5", import.meta.webpackHot); @@ -718,25 +808,31 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = () => { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -749,15 +845,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -770,15 +869,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -794,15 +896,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -818,17 +923,22 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -849,7 +959,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -880,16 +990,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -899,7 +1012,10 @@ const Bar = _$$component(_REGISTRY, "Bar", () => { location: "example.jsx:2:20", signature: "d1c6ca9b" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -923,13 +1039,16 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); }; if (import.meta.webpackHot) { _$$decline("webpack5", import.meta.webpackHot); @@ -937,25 +1056,31 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; // @refresh skip const Foo = function () { - return _$ssr(_tmpl$, _$ssrHydrationKey()); + return (() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); + })(); };" `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const JSX_foo_1 = _$$component(_REGISTRY, "JSX_foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -968,15 +1093,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -989,15 +1117,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1013,15 +1144,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "4b145a58" }); @@ -1037,17 +1171,22 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["", ""]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey(), _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _v$2 = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$, _v$2); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1068,7 +1207,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1099,16 +1238,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["bar"], _tmpl$2 = ["foo"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Bar_1 = _$$component(_REGISTRY, "Bar_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:3:17", signature: "61dd3182" }); @@ -1118,7 +1260,10 @@ const Bar = _$$component(_REGISTRY, "Bar", function () { location: "example.jsx:2:20", signature: "1fb34faa" }); -const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/_$ssr(_tmpl$2, _$ssrHydrationKey()), { +const Foo_1_1 = _$$component(_REGISTRY, "Foo_1_1", _props3 => /*@refresh jsx-skip*/(() => { + var _v$2 = _$ssrHydrationKey(); + return _$ssr(_tmpl$2, _v$2); +})(), { location: "example.jsx:8:14", signature: "241c14a4" }); @@ -1142,15 +1287,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1169,15 +1318,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1202,16 +1355,20 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { ssrHydrationKey as _$ssrHydrationKey } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrHydrationKey as _$ssrHydrationKey } from "@solidjs/web"; var _tmpl$ = ["Comp"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$ssrHydrationKey()), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrHydrationKey(), + _ref$ = _props.v0; + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1237,10 +1394,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1251,11 +1408,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1271,11 +1428,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1291,11 +1448,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1311,11 +1468,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1331,11 +1488,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server-hydratable/esm.test.ts b/tests/server-hydratable/esm.test.ts index 1f55074..88ef3a0 100644 --- a/tests/server-hydratable/esm.test.ts +++ b/tests/server-hydratable/esm.test.ts @@ -719,7 +719,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('esm (server, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server-hydratable/rspack-esm.test.ts b/tests/server-hydratable/rspack-esm.test.ts index 15615c3..a9a65fc 100644 --- a/tests/server-hydratable/rspack-esm.test.ts +++ b/tests/server-hydratable/rspack-esm.test.ts @@ -719,7 +719,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('esm (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('esm (server, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server-hydratable/standard.test.ts b/tests/server-hydratable/standard.test.ts index 77cd43a..1daf8f6 100644 --- a/tests/server-hydratable/standard.test.ts +++ b/tests/server-hydratable/standard.test.ts @@ -719,7 +719,7 @@ describe('standard (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('standard (server, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('standard (server, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('standard (server, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('standard (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('standard (server, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server-hydratable/vite.test.ts b/tests/server-hydratable/vite.test.ts index 69a9f6b..bd51647 100644 --- a/tests/server-hydratable/vite.test.ts +++ b/tests/server-hydratable/vite.test.ts @@ -719,7 +719,7 @@ describe('vite (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('vite (server, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('vite (server, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('vite (server, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('vite (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('vite (server, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server-hydratable/webpack5.test.ts b/tests/server-hydratable/webpack5.test.ts index 1774f21..8b3218b 100644 --- a/tests/server-hydratable/webpack5.test.ts +++ b/tests/server-hydratable/webpack5.test.ts @@ -719,7 +719,7 @@ describe('webpack5 (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('webpack5 (server, hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('webpack5 (server, hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('webpack5 (server, hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('webpack5 (server, hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('webpack5 (server, hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server/__snapshots__/esm.test.ts.snap b/tests/server/__snapshots__/esm.test.ts.snap index 0b0eb5f..7cc11b4 100644 --- a/tests/server/__snapshots__/esm.test.ts.snap +++ b/tests/server/__snapshots__/esm.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`esm (server, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { _$$refresh("esm", import.meta.hot, _REGISTRY); }" `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,15 +142,19 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -173,7 +177,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -205,8 +209,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -248,7 +252,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -261,7 +265,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export function Foo() { @@ -270,8 +274,8 @@ export function Foo() { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -294,8 +298,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -314,8 +318,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -338,8 +342,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -362,15 +366,19 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -393,7 +401,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -425,8 +433,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -469,7 +477,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -482,7 +490,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip function Foo() { @@ -491,8 +499,8 @@ function Foo() { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -511,8 +519,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -531,8 +539,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -554,8 +562,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -577,15 +585,19 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -607,7 +619,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -638,8 +650,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -680,7 +692,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -693,7 +705,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = () => { @@ -702,8 +714,8 @@ const Foo = () => { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -722,8 +734,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -742,8 +754,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -765,8 +777,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -788,16 +800,20 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -818,7 +834,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -849,8 +865,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -891,7 +907,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -904,7 +920,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = function () { @@ -913,8 +929,8 @@ const Foo = function () { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -933,8 +949,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -953,8 +969,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -976,8 +992,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -999,16 +1015,20 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1029,7 +1049,7 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1060,8 +1080,8 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -1102,14 +1122,17 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1128,14 +1151,17 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1160,15 +1186,18 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1194,10 +1223,10 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1208,11 +1237,11 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1228,11 +1257,11 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1248,11 +1277,11 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1268,11 +1297,11 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1288,11 +1317,11 @@ if (import.meta.hot) { `; exports[`esm (server, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server/__snapshots__/rspack-esm.test.ts.snap b/tests/server/__snapshots__/rspack-esm.test.ts.snap index 065c478..71158b8 100644 --- a/tests/server/__snapshots__/rspack-esm.test.ts.snap +++ b/tests/server/__snapshots__/rspack-esm.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`rspack-esm (server, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (server, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("rspack-esm", import.meta.webpackHot, _REGISTRY); }" `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,15 +142,19 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -173,7 +177,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -205,8 +209,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -248,7 +252,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -261,7 +265,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export function Foo() { @@ -270,8 +274,8 @@ export function Foo() { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -294,8 +298,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -314,8 +318,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -338,8 +342,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -362,15 +366,19 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -393,7 +401,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -425,8 +433,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -469,7 +477,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -482,7 +490,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip function Foo() { @@ -491,8 +499,8 @@ function Foo() { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -511,8 +519,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -531,8 +539,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -554,8 +562,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -577,15 +585,19 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -607,7 +619,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -638,8 +650,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -680,7 +692,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -693,7 +705,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = () => { @@ -702,8 +714,8 @@ const Foo = () => { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -722,8 +734,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -742,8 +754,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -765,8 +777,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -788,16 +800,20 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -818,7 +834,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -849,8 +865,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -891,7 +907,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -904,7 +920,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = function () { @@ -913,8 +929,8 @@ const Foo = function () { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -933,8 +949,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -953,8 +969,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -976,8 +992,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -999,16 +1015,20 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1029,7 +1049,7 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1060,8 +1080,8 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -1102,14 +1122,17 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1128,14 +1151,17 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1160,15 +1186,18 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1194,10 +1223,10 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1208,11 +1237,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1228,11 +1257,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1248,11 +1277,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1268,11 +1297,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1288,11 +1317,11 @@ if (import.meta.webpackHot) { `; exports[`rspack-esm (server, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server/__snapshots__/standard.test.ts.snap b/tests/server/__snapshots__/standard.test.ts.snap index bc312d8..37578a0 100644 --- a/tests/server/__snapshots__/standard.test.ts.snap +++ b/tests/server/__snapshots__/standard.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`standard (server, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (server, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (module.hot) { _$$refresh("standard", module.hot, _REGISTRY); }" `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,15 +142,19 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -173,7 +177,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -205,8 +209,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -248,7 +252,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -261,7 +265,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export function Foo() { @@ -270,8 +274,8 @@ export function Foo() { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -294,8 +298,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -314,8 +318,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -338,8 +342,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -362,15 +366,19 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -393,7 +401,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -425,8 +433,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -469,7 +477,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -482,7 +490,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip function Foo() { @@ -491,8 +499,8 @@ function Foo() { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -511,8 +519,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -531,8 +539,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -554,8 +562,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -577,15 +585,19 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -607,7 +619,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -638,8 +650,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -680,7 +692,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -693,7 +705,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = () => { @@ -702,8 +714,8 @@ const Foo = () => { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -722,8 +734,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -742,8 +754,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -765,8 +777,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -788,16 +800,20 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -818,7 +834,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -849,8 +865,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -891,7 +907,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -904,7 +920,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = function () { @@ -913,8 +929,8 @@ const Foo = function () { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -933,8 +949,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -953,8 +969,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -976,8 +992,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -999,16 +1015,20 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1029,7 +1049,7 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1060,8 +1080,8 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -1102,14 +1122,17 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1128,14 +1151,17 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1160,15 +1186,18 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1194,10 +1223,10 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (module.hot) module.hot.dispose(_cleanup); @@ -1208,11 +1237,11 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1228,11 +1257,11 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1248,11 +1277,11 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1268,11 +1297,11 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1288,11 +1317,11 @@ if (module.hot) { `; exports[`standard (server, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server/__snapshots__/vite.test.ts.snap b/tests/server/__snapshots__/vite.test.ts.snap index 0f992b1..226a1a5 100644 --- a/tests/server/__snapshots__/vite.test.ts.snap +++ b/tests/server/__snapshots__/vite.test.ts.snap @@ -8,12 +8,12 @@ if (someCond) { `; exports[`vite (server, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -21,12 +21,12 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.hot) { import.meta.hot.accept(); _$$refresh("vite", import.meta.hot, _REGISTRY); @@ -34,7 +34,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh reload export default function Foo() { @@ -46,7 +46,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export default function Foo() { @@ -55,8 +55,8 @@ export default function Foo() { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -76,8 +76,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -97,8 +97,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -122,8 +122,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -147,15 +147,19 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -179,7 +183,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -212,8 +216,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -256,7 +260,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh reload export function Foo() { @@ -268,7 +272,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export function Foo() { @@ -277,8 +281,8 @@ export function Foo() { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -302,8 +306,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -323,8 +327,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -348,8 +352,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -373,15 +377,19 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -405,7 +413,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -438,8 +446,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -483,7 +491,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh reload function Foo() { @@ -495,7 +503,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip function Foo() { @@ -504,8 +512,8 @@ function Foo() { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -525,8 +533,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -546,8 +554,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -570,8 +578,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -594,15 +602,19 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -625,7 +637,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -657,8 +669,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -700,7 +712,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh reload const Foo = () => { @@ -712,7 +724,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = () => { @@ -721,8 +733,8 @@ const Foo = () => { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -742,8 +754,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -763,8 +775,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -787,8 +799,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -811,16 +823,20 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -842,7 +858,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -874,8 +890,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -917,7 +933,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh reload const Foo = function () { @@ -929,7 +945,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = function () { @@ -938,8 +954,8 @@ const Foo = function () { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -959,8 +975,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -980,8 +996,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1004,8 +1020,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -1028,16 +1044,20 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1059,7 +1079,7 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1091,8 +1111,8 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -1134,14 +1154,17 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1161,14 +1184,17 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1194,15 +1220,18 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1229,9 +1258,9 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.hot) import.meta.hot.dispose(_cleanup); @@ -1242,11 +1271,11 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1263,11 +1292,11 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1284,11 +1313,11 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1305,11 +1334,11 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1326,11 +1355,11 @@ if (import.meta.hot) { `; exports[`vite (server, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server/__snapshots__/webpack5.test.ts.snap b/tests/server/__snapshots__/webpack5.test.ts.snap index 1e4d9ab..bbf6c72 100644 --- a/tests/server/__snapshots__/webpack5.test.ts.snap +++ b/tests/server/__snapshots__/webpack5.test.ts.snap @@ -8,31 +8,31 @@ if (someCond) { `; exports[`webpack5 (server, non-hydratable) > Context API > should support ExportNamedDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -export const Example = _$$context(_REGISTRY, "Example", createContext()); +export const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (server, non-hydratable) > Context API > should support top-level VariableDeclaration 1`] = ` -"import { $$context as _$$context } from "solid-refresh"; +"import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createContext } from 'solid-js'; const _REGISTRY = _$$registry(); -const Example = _$$context(_REGISTRY, "Example", createContext()); +const Example = _$$component(_REGISTRY, "Example", createContext()); if (import.meta.webpackHot) { _$$refresh("webpack5", import.meta.webpackHot, _REGISTRY); }" `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -45,7 +45,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export default function Foo() { @@ -54,8 +54,8 @@ export default function Foo() { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -74,8 +74,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should skip ExportDefaultDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -94,8 +94,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -118,8 +118,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -142,15 +142,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -173,7 +177,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -205,8 +209,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportDefaultDeclaration w/ FunctionExpression > should transform ExportDefaultDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -248,7 +252,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -261,7 +265,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip export function Foo() { @@ -270,8 +274,8 @@ export function Foo() { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -294,8 +298,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should skip ExportNamedDeclaration w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -314,8 +318,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -338,8 +342,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -362,15 +366,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -393,7 +401,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -425,8 +433,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > ExportNamedDeclaration w/ FunctionExpression > should transform ExportNamedDeclaration w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -469,7 +477,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -482,7 +490,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip function Foo() { @@ -491,8 +499,8 @@ function Foo() { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -511,8 +519,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should skip FunctionDeclaration with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -531,8 +539,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -554,8 +562,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -577,15 +585,19 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:15", signature: "ae0f2a31" }); @@ -607,7 +619,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -638,8 +650,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > FunctionDeclaration > should transform FunctionDeclaration with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
foo
", _tmpl$2 = "
bar
"; import { $$component as _$$component } from "solid-refresh"; @@ -680,7 +692,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -693,7 +705,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = () => { @@ -702,8 +714,8 @@ const Foo = () => { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -722,8 +734,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should skip VariableDeclarator w/ ArrowFunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -742,8 +754,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -765,8 +777,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -788,16 +800,20 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -818,7 +834,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -849,8 +865,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > ArrowFunctionExpression > should transform VariableDeclarator w/ ArrowFunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -891,7 +907,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh reload 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload @@ -904,7 +920,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with @refresh skip 1`] = ` -"import { ssr as _$ssr } from "solid-js/web"; +"import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; // @refresh skip const Foo = function () { @@ -913,8 +929,8 @@ const Foo = function () { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with invalid Component name 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -933,8 +949,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should skip VariableDeclarator w/ FunctionExpression with valid Component name and >1 params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -953,8 +969,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -976,8 +992,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 2`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "

Foo

"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; @@ -999,16 +1015,20 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 3`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; -import { escape as _$escape } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; +import { ssrRunInScope as _$ssrRunInScope } from "@solidjs/web"; +import { escape as _$escape } from "@solidjs/web"; var _tmpl$ = ["

", "

"]; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const example = 'Foo'; const _REGISTRY = _$$registry(); -const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$, _$escape(_props.v0)), { +const Foo_1 = _$$component(_REGISTRY, "Foo_1", _props => /*@refresh jsx-skip*/(() => { + var _v$ = _$ssrRunInScope(() => _$escape(_props.v0)); + return _$ssr(_tmpl$, _v$); +})(), { location: "example.jsx:4:17", signature: "ae0f2a31" }); @@ -1029,7 +1049,7 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 4`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; @@ -1060,8 +1080,8 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > VariableDeclarator > FunctionExpression > should transform VariableDeclarator w/ FunctionExpression with valid Component name and params 5`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
bar
", _tmpl$2 = "
foo
"; import { $$component as _$$component } from "solid-refresh"; @@ -1102,14 +1122,17 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix build > refs > should work with a function 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1128,14 +1151,17 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix build > refs > should work with a mutable variable 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:4:19", signature: "6f76290" }); @@ -1160,15 +1186,18 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix build > signals as refs > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; -import { ssr as _$ssr } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; +import { ssr as _$ssr } from "@solidjs/web"; var _tmpl$ = "
Comp
"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; import { createSignal } from 'solid-js'; const _REGISTRY = _$$registry(); -const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/_$ssr(_tmpl$), { +const Comp_1 = _$$component(_REGISTRY, "Comp_1", _props => /*@refresh jsx-skip*/(() => { + var _ref$ = _props.v0; + return _$ssr(_tmpl$); +})(), { location: "example.jsx:6:19", signature: "6f76290" }); @@ -1194,10 +1223,10 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > @refresh reload > should work 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$decline as _$$decline } from "solid-refresh"; // @refresh reload -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; if (root) { const _cleanup = render(() => _$createComponent(App, {}), root); if (import.meta.webpackHot) import.meta.webpackHot.dispose(_cleanup); @@ -1208,11 +1237,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > import specifiers > should work with ImportNamespaceSpecifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import * as solidWeb from 'solid-js/web'; +import * as solidWeb from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:32", @@ -1228,11 +1257,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1248,11 +1277,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render as Render } from 'solid-js/web'; +import { render as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1268,11 +1297,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > import specifiers > should work with ImportSpecifier + aliased Identifier from StringLiteral 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { 'render' as Render } from 'solid-js/web'; +import { 'render' as Render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:4:23", @@ -1288,11 +1317,11 @@ if (import.meta.webpackHot) { `; exports[`webpack5 (server, non-hydratable) > fix render > top-level statements > should work with IfStatement 1`] = ` -"import { createComponent as _$createComponent } from "solid-js/web"; +"import { createComponent as _$createComponent } from "@solidjs/web"; import { $$component as _$$component } from "solid-refresh"; import { $$refresh as _$$refresh } from "solid-refresh"; import { $$registry as _$$registry } from "solid-refresh"; -import { render } from 'solid-js/web'; +import { render } from '@solidjs/web'; const _REGISTRY = _$$registry(); const JSX__cleanup_1 = _$$component(_REGISTRY, "JSX__cleanup_1", _props => /*@refresh jsx-skip*/_$createComponent(_props.v0, {}), { location: "example.jsx:5:25", diff --git a/tests/server/esm.test.ts b/tests/server/esm.test.ts index c472adc..202ebc7 100644 --- a/tests/server/esm.test.ts +++ b/tests/server/esm.test.ts @@ -719,7 +719,7 @@ describe('esm (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('esm (server, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('esm (server, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('esm (server, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('esm (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('esm (server, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server/rspack-esm.test.ts b/tests/server/rspack-esm.test.ts index e0b412a..8370645 100644 --- a/tests/server/rspack-esm.test.ts +++ b/tests/server/rspack-esm.test.ts @@ -719,7 +719,7 @@ describe('rspack-esm (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('rspack-esm (server, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('rspack-esm (server, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('rspack-esm (server, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('rspack-esm (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('rspack-esm (server, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server/standard.test.ts b/tests/server/standard.test.ts index b34a844..879865a 100644 --- a/tests/server/standard.test.ts +++ b/tests/server/standard.test.ts @@ -719,7 +719,7 @@ describe('standard (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('standard (server, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('standard (server, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('standard (server, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('standard (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('standard (server, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server/vite.test.ts b/tests/server/vite.test.ts index ab0ef1b..ed8ef44 100644 --- a/tests/server/vite.test.ts +++ b/tests/server/vite.test.ts @@ -719,7 +719,7 @@ describe('vite (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('vite (server, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('vite (server, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('vite (server, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('vite (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('vite (server, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); diff --git a/tests/server/webpack5.test.ts b/tests/server/webpack5.test.ts index 97e0fe1..718f3e7 100644 --- a/tests/server/webpack5.test.ts +++ b/tests/server/webpack5.test.ts @@ -719,7 +719,7 @@ describe('webpack5 (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; render(() => , root); `, @@ -733,7 +733,7 @@ describe('webpack5 (server, non-hydratable)', () => { expect( await transform( ` - import { render as Render } from 'solid-js/web'; + import { render as Render } from '@solidjs/web'; Render(() => , root); `, @@ -747,7 +747,7 @@ describe('webpack5 (server, non-hydratable)', () => { expect( await transform( ` - import { 'render' as Render } from 'solid-js/web'; + import { 'render' as Render } from '@solidjs/web'; Render(() => , root); `, @@ -761,7 +761,7 @@ describe('webpack5 (server, non-hydratable)', () => { expect( await transform( ` - import * as solidWeb from 'solid-js/web'; + import * as solidWeb from '@solidjs/web'; solidWeb.render(() => , root); `, @@ -777,7 +777,7 @@ describe('webpack5 (server, non-hydratable)', () => { expect( await transform( ` - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root); @@ -796,7 +796,7 @@ describe('webpack5 (server, non-hydratable)', () => { await transform( ` // @refresh reload - import { render } from 'solid-js/web'; + import { render } from '@solidjs/web'; if (root) { render(() => , root);