mirror of https://github.com/sveltejs/svelte
chore: remove template expression inlining (#14374)
* chore: remove template expression inlining * missed some * fix * feedback * feedback * Update packages/svelte/src/compiler/phases/3-transform/client/utils.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * fix * Update .changeset/calm-mice-perform.md Co-authored-by: Rich Harris <rich.harris@vercel.com> --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/14377/head
parent
f616c22053
commit
9d12fd1a01
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: remove template expression inlining
|
@ -1,17 +0,0 @@
|
||||
import "svelte/internal/disclose-version";
|
||||
import * as $ from "svelte/internal/client";
|
||||
|
||||
const __DECLARED_ASSET_0__ = "__VITE_ASSET__2AM7_y_a__ 1440w, __VITE_ASSET__2AM7_y_b__ 960w";
|
||||
const __DECLARED_ASSET_1__ = "__VITE_ASSET__2AM7_y_c__ 1440w, __VITE_ASSET__2AM7_y_d__ 960w";
|
||||
const __DECLARED_ASSET_2__ = "__VITE_ASSET__2AM7_y_e__ 1440w, __VITE_ASSET__2AM7_y_f__ 960w";
|
||||
const __DECLARED_ASSET_3__ = "__VITE_ASSET__2AM7_y_g__";
|
||||
const a = 1;
|
||||
const b = 2;
|
||||
var root = $.template(`<picture><source srcset="${__DECLARED_ASSET_0__}" type="image/avif"> <source srcset="${__DECLARED_ASSET_1__}" type="image/webp"> <source srcset="${__DECLARED_ASSET_2__}" type="image/png"> <img src="${__DECLARED_ASSET_3__}" alt="production test" width="1440" height="1440"></picture> <p>${a} + ${b} = ${$.escape(a + b ?? "")}</p>`, 1);
|
||||
|
||||
export default function Inline_module_vars($$anchor) {
|
||||
var fragment = root();
|
||||
|
||||
$.next(2);
|
||||
$.append($$anchor, fragment);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import * as $ from "svelte/internal/server";
|
||||
|
||||
const __DECLARED_ASSET_0__ = "__VITE_ASSET__2AM7_y_a__ 1440w, __VITE_ASSET__2AM7_y_b__ 960w";
|
||||
const __DECLARED_ASSET_1__ = "__VITE_ASSET__2AM7_y_c__ 1440w, __VITE_ASSET__2AM7_y_d__ 960w";
|
||||
const __DECLARED_ASSET_2__ = "__VITE_ASSET__2AM7_y_e__ 1440w, __VITE_ASSET__2AM7_y_f__ 960w";
|
||||
const __DECLARED_ASSET_3__ = "__VITE_ASSET__2AM7_y_g__";
|
||||
const a = 1;
|
||||
const b = 2;
|
||||
|
||||
export default function Inline_module_vars($$payload) {
|
||||
$$payload.out += `<picture><source${$.attr("srcset", __DECLARED_ASSET_0__)} type="image/avif"> <source${$.attr("srcset", __DECLARED_ASSET_1__)} type="image/webp"> <source${$.attr("srcset", __DECLARED_ASSET_2__)} type="image/png"> <img${$.attr("src", __DECLARED_ASSET_3__)} alt="production test"${$.attr("width", 1440)}${$.attr("height", 1440)}></picture> <p>${$.escape(a)} + ${$.escape(b)} = ${$.escape(a + b)}</p>`;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<svelte:options runes={true} />
|
||||
|
||||
<script module>
|
||||
const __DECLARED_ASSET_0__ = "__VITE_ASSET__2AM7_y_a__ 1440w, __VITE_ASSET__2AM7_y_b__ 960w";
|
||||
const __DECLARED_ASSET_1__ = "__VITE_ASSET__2AM7_y_c__ 1440w, __VITE_ASSET__2AM7_y_d__ 960w";
|
||||
const __DECLARED_ASSET_2__ = "__VITE_ASSET__2AM7_y_e__ 1440w, __VITE_ASSET__2AM7_y_f__ 960w";
|
||||
const __DECLARED_ASSET_3__ = "__VITE_ASSET__2AM7_y_g__";
|
||||
|
||||
const a = 1;
|
||||
const b = 2;
|
||||
</script>
|
||||
|
||||
<picture>
|
||||
<source srcset={__DECLARED_ASSET_0__} type="image/avif" />
|
||||
<source srcset={__DECLARED_ASSET_1__} type="image/webp" />
|
||||
<source srcset={__DECLARED_ASSET_2__} type="image/png" />
|
||||
<img src={__DECLARED_ASSET_3__} alt="production test" width={1440} height={1440} />
|
||||
</picture>
|
||||
|
||||
<p>{a} + {b} = {a + b}</p>
|
Loading…
Reference in new issue