diff options
author | 2022-05-20 00:45:51 -0700 | |
---|---|---|
committer | 2022-05-20 00:45:51 -0700 | |
commit | 99d61877d6f411f33e0db578f04b333fb2110ddd (patch) | |
tree | 8802bd59e55c8ed3b5eec695209e59fd28ddfef4 /integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation | |
parent | 224cfa91fb550d3acb5d5fefdcc0594d7a12f1dc (diff) | |
download | bun-99d61877d6f411f33e0db578f04b333fb2110ddd.tar.gz bun-99d61877d6f411f33e0db578f04b333fb2110ddd.tar.zst bun-99d61877d6f411f33e0db578f04b333fb2110ddd.zip |
[solid] more progress, no fragments, but still not right
Diffstat (limited to 'integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation')
3 files changed, 287 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/code.js b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/code.js new file mode 100644 index 000000000..21698ea89 --- /dev/null +++ b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/code.js @@ -0,0 +1,72 @@ +const trailing = <span>Hello </span>; +const leading = <span> John</span>; + +/* prettier-ignore */ +const extraSpaces = <span>Hello John</span>; + +const trailingExpr = <span>Hello {name}</span>; +const leadingExpr = <span>{greeting} John</span>; + +/* prettier-ignore */ +const multiExpr = <span>{greeting} {name}</span>; + +/* prettier-ignore */ +const multiExprSpaced = <span> {greeting} {name} </span>; + +/* prettier-ignore */ +const multiExprTogether = <span> {greeting}{name} </span>; + +/* prettier-ignore */ +const multiLine = <span> + + Hello + +</span> + +/* prettier-ignore */ +const multiLineTrailingSpace = <span> + Hello + John +</span> + +/* prettier-ignore */ +const multiLineNoTrailingSpace = <span> + Hello + John +</span> + +/* prettier-ignore */ +const escape = <span> + <Hi> +</span> + +/* prettier-ignore */ +const escape2 = <Comp> + <Hi> +</Comp> + +/* prettier-ignore */ +const escape3 = <> + <Hi> +</> + +const injection = <span>Hi{"<script>alert();</script>"}</span>; + +let value = "World"; +const evaluated = <span>Hello {value + "!"}</span>; + +let number = 4 + 5; +const evaluatedNonString = <span>4 + 5 = {number}</span>; + +const newLineLiteral = ( + <div> + {s} + {"\n"}d + </div> +); + +const trailingSpace = <div>{expr}</div>; + +const trailingSpaceComp = <Comp>{expr}</Comp>; + +const trailingSpaceFrag = <>{expr}</>; diff --git a/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.bun.js b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.bun.js new file mode 100644 index 000000000..eb4c5347a --- /dev/null +++ b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.bun.js @@ -0,0 +1,71 @@ +var _tmpl$1 = template("<span>Hello </span>", 2), _tmpl$2 = template("<span> John</span>", 2), _tmpl$3 = template("<span>Hello John</span>", 2), _tmpl$3 = template("<span> </span>", 4), _tmpl$4 = template("<span> </span>", 4), _tmpl$5 = template("<span> </span>", 4), _tmpl$7 = template("<span>Hello</span>", 2), _tmpl$8 = template("<span>Hello John</span>", 2), _tmpl$9 = template("<span> <Hi> </span>", 2), _tmpl$10 = template("<span>Hi<script>alert();</script></span>", 2), _tmpl$10 = template("<span>4 + 5 = </span>", 3), _tmpl$11 = template("<div>\nd</div>", 3), _tmpl$12 = template("<div</div>", 2); +const trailing = _tmpl$1.cloneNode(true); +const leading = _tmpl$2.cloneNode(true); +const extraSpaces = _tmpl$3.cloneNode(true); +const trailingExpr = () => { + var _tmpl$1 = _tmpl$1.cloneNode(true); + insert(_tmpl$1, name, null); + return _tmpl$1; +}; +const leadingExpr = () => { + var _tmpl$2 = _tmpl$2.cloneNode(true); + insert(_tmpl$2, greeting, null); + return _tmpl$2; +}; +const multiExpr = () => { + var _tmpl$3 = _tmpl$3.cloneNode(true); + insert(_tmpl$3, greeting, null); + insert(_tmpl$3, name, null); + return _tmpl$3; +}; +const multiExprSpaced = () => { + var _tmpl$4 = _tmpl$4.cloneNode(true); + insert(_tmpl$4, greeting, null); + insert(_tmpl$4, name, null); + return _tmpl$4; +}; +const multiExprTogether = () => { + var _tmpl$5 = _tmpl$5.cloneNode(true); + insert(_tmpl$5, greeting, null); + insert(_tmpl$5, name, null); + return _tmpl$5; +}; +const multiLine = _tmpl$7.cloneNode(true); +const multiLineTrailingSpace = _tmpl$8.cloneNode(true); +const multiLineNoTrailingSpace = _tmpl$8.cloneNode(true); +const escape = _tmpl$9.cloneNode(true); +const escape2 = createComponent(Comp, { + get children: [ + "\xA0<Hi>\xA0" + ] +}); +const escape3 = ; +const injection = _tmpl$10.cloneNode(true); +let value = "World"; +const evaluated = () => { + var _tmpl$1 = _tmpl$1.cloneNode(true); + insert(_tmpl$1, value + "!", null); + return _tmpl$1; +}; +let number = 4 + 5; +const evaluatedNonString = () => { + var _tmpl$10 = _tmpl$10.cloneNode(true); + insert(_tmpl$10, number, null); + return _tmpl$10; +}; +const newLineLiteral = () => { + var _tmpl$11 = _tmpl$11.cloneNode(true); + insert(_tmpl$11, s, null); + return _tmpl$11; +}; +const trailingSpace = () => { + var _tmpl$12 = _tmpl$12.cloneNode(true); + insert(_tmpl$12, expr, null); + return _tmpl$12; +}; +const trailingSpaceComp = createComponent(Comp, { + get children: [ + expr + ] +}); +const trailingSpaceFrag = ; diff --git a/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.js b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.js new file mode 100644 index 000000000..b86a631fb --- /dev/null +++ b/integration/bunjs-only-snippets/solid-dom-fixtures/textInterpolation/output.js @@ -0,0 +1,144 @@ +import { template as _$template } from "r-dom"; +import { createComponent as _$createComponent } from "r-dom"; +import { insert as _$insert } from "r-dom"; + +const _tmpl$ = /*#__PURE__*/ _$template(`<span>Hello </span>`, 2), + _tmpl$2 = /*#__PURE__*/ _$template(`<span> John</span>`, 2), + _tmpl$3 = /*#__PURE__*/ _$template(`<span>Hello John</span>`, 2), + _tmpl$4 = /*#__PURE__*/ _$template(`<span> </span>`, 2), + _tmpl$5 = /*#__PURE__*/ _$template(`<span> <!> <!> </span>`, 4), + _tmpl$6 = /*#__PURE__*/ _$template(`<span> <!> </span>`, 3), + _tmpl$7 = /*#__PURE__*/ _$template(`<span>Hello</span>`, 2), + _tmpl$8 = /*#__PURE__*/ _$template(`<span> <Hi> </span>`, 2), + _tmpl$9 = /*#__PURE__*/ _$template( + `<span>Hi<script>alert();</script></span>`, + 2 + ), + _tmpl$10 = /*#__PURE__*/ _$template(`<span>Hello World!</span>`, 2), + _tmpl$11 = /*#__PURE__*/ _$template(`<span>4 + 5 = 9</span>`, 2), + _tmpl$12 = /*#__PURE__*/ _$template( + `<div> +d</div>`, + 2 + ), + _tmpl$13 = /*#__PURE__*/ _$template(`<div></div>`, 2); + +const trailing = _tmpl$.cloneNode(true); + +const leading = _tmpl$2.cloneNode(true); +/* prettier-ignore */ + +const extraSpaces = _tmpl$3.cloneNode(true); + +const trailingExpr = (() => { + const _el$4 = _tmpl$.cloneNode(true), + _el$5 = _el$4.firstChild; + + _$insert(_el$4, name, null); + + return _el$4; +})(); + +const leadingExpr = (() => { + const _el$6 = _tmpl$2.cloneNode(true), + _el$7 = _el$6.firstChild; + + _$insert(_el$6, greeting, _el$7); + + return _el$6; +})(); +/* prettier-ignore */ + +const multiExpr = (() => { + const _el$8 = _tmpl$4.cloneNode(true), + _el$9 = _el$8.firstChild; + + _$insert(_el$8, greeting, _el$9); + + _$insert(_el$8, name, null); + + return _el$8; +})(); +/* prettier-ignore */ + +const multiExprSpaced = (() => { + const _el$10 = _tmpl$5.cloneNode(true), + _el$11 = _el$10.firstChild, + _el$14 = _el$11.nextSibling, + _el$12 = _el$14.nextSibling, + _el$15 = _el$12.nextSibling, + _el$13 = _el$15.nextSibling; + + _$insert(_el$10, greeting, _el$14); + + _$insert(_el$10, name, _el$15); + + return _el$10; +})(); +/* prettier-ignore */ + +const multiExprTogether = (() => { + const _el$16 = _tmpl$6.cloneNode(true), + _el$17 = _el$16.firstChild, + _el$19 = _el$17.nextSibling, + _el$18 = _el$19.nextSibling; + + _$insert(_el$16, greeting, _el$19); + + _$insert(_el$16, name, _el$19); + + return _el$16; +})(); +/* prettier-ignore */ + +const multiLine = _tmpl$7.cloneNode(true); +/* prettier-ignore */ + +const multiLineTrailingSpace = _tmpl$3.cloneNode(true); +/* prettier-ignore */ + +const multiLineNoTrailingSpace = _tmpl$3.cloneNode(true); +/* prettier-ignore */ + +const escape = _tmpl$8.cloneNode(true); +/* prettier-ignore */ + +const escape2 = _$createComponent(Comp, { + children: "\xA0<Hi>\xA0" +}); +/* prettier-ignore */ + +const escape3 = "\xA0<Hi>\xA0"; + +const injection = _tmpl$9.cloneNode(true); + +let value = "World"; + +const evaluated = _tmpl$10.cloneNode(true); + +let number = 4 + 5; + +const evaluatedNonString = _tmpl$11.cloneNode(true); + +const newLineLiteral = (() => { + const _el$27 = _tmpl$12.cloneNode(true), + _el$28 = _el$27.firstChild; + + _$insert(_el$27, s, _el$28); + + return _el$27; +})(); + +const trailingSpace = (() => { + const _el$29 = _tmpl$13.cloneNode(true); + + _$insert(_el$29, expr); + + return _el$29; +})(); + +const trailingSpaceComp = _$createComponent(Comp, { + children: expr, +}); + +const trailingSpaceFrag = expr; |