diff options
Diffstat (limited to 'integration/snapshots')
12 files changed, 250 insertions, 166 deletions
diff --git a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js index 53bb66b5e..783769a85 100644 --- a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js @@ -1,38 +1,12 @@ -import { -__require as require -} from "http://localhost:8080/__runtime.js"; -import { -__cJS2eSM -} from "http://localhost:8080/__runtime.js"; -import * as _login_b977_0 from "http://localhost:8080/_login.js"; -import * as _login_b977_1 from "http://localhost:8080/_login.js"; import _login from "http://localhost:8080/_login.js"; import _auth from "http://localhost:8080/_auth.js"; import * as _loginReally from "http://localhost:8080/_login.js"; import * as _loginReally2 from "http://localhost:8080/_login.js"; import * as _authReally from "http://localhost:8080/_auth.js"; -export default __cJS2eSM(function(module, exports) { - ; - - ; - ; - ; - ; - module.exports.iAmCommonJs = true; - exports.YouAreCommonJS = true; - require(_login_b977_0); - require(_login_b977_1); - Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); - function test() { - return testDone(import.meta.url); - }; -var test = test; - Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); - let foo, bar; - Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, -'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); -}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); - - +export {_login as login}; +export function test() { + return testDone(import.meta.url); +} +export let foo, bar; diff --git a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js index fa25e2df8..2ca15542e 100644 --- a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js @@ -1,38 +1,40 @@ import { -__require as require +__HMRModule as HMR } from "http://localhost:8080/__runtime.js"; import { -__cJS2eSM +__HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -import * as _login_b977_0 from "http://localhost:8080/_login.js"; -import * as _login_b977_1 from "http://localhost:8080/_login.js"; import _login from "http://localhost:8080/_login.js"; import _auth from "http://localhost:8080/_auth.js"; import * as _loginReally from "http://localhost:8080/_login.js"; import * as _loginReally2 from "http://localhost:8080/_login.js"; import * as _authReally from "http://localhost:8080/_auth.js"; +Bun.activate(true); -export default __cJS2eSM(function(module, exports) { - ; - - ; - ; - ; - ; - module.exports.iAmCommonJs = true; - exports.YouAreCommonJS = true; - require(_login_b977_0); - require(_login_b977_1); - Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); +var hmr = new HMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"), exports = hmr.exports; +(hmr._load = function() { function test() { return testDone(import.meta.url); - }; -var test = test; - Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); + } var foo, bar; - Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, -'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); -}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); - - + hmr.exportAll({ + login: () => _login, + test: () => test, + foo: () => foo, + bar: () => bar + }); +})(); +var $$hmr_login = hmr.exports.login, $$hmr_test = hmr.exports.test, $$hmr_foo = hmr.exports.foo, $$hmr_bar = hmr.exports.bar; +hmr._update = function(exports) { + $$hmr_login = exports.login; + $$hmr_test = exports.test; + $$hmr_foo = exports.foo; + $$hmr_bar = exports.bar; +}; +export { + $$hmr_login as login, + $$hmr_test as test, + $$hmr_foo as foo, + $$hmr_bar as bar +}; diff --git a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js index fa25e2df8..ef0bd004e 100644 --- a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js @@ -1,38 +1,40 @@ import { -__require as require +__HMRModule as HMR } from "http://localhost:8080/__runtime.js"; import { -__cJS2eSM +__HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -import * as _login_b977_0 from "http://localhost:8080/_login.js"; -import * as _login_b977_1 from "http://localhost:8080/_login.js"; import _login from "http://localhost:8080/_login.js"; import _auth from "http://localhost:8080/_auth.js"; import * as _loginReally from "http://localhost:8080/_login.js"; import * as _loginReally2 from "http://localhost:8080/_login.js"; import * as _authReally from "http://localhost:8080/_auth.js"; +Bun.activate(false); -export default __cJS2eSM(function(module, exports) { - ; - - ; - ; - ; - ; - module.exports.iAmCommonJs = true; - exports.YouAreCommonJS = true; - require(_login_b977_0); - require(_login_b977_1); - Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); +var hmr = new HMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"), exports = hmr.exports; +(hmr._load = function() { function test() { return testDone(import.meta.url); - }; -var test = test; - Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); + } var foo, bar; - Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, -'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); -}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); - - + hmr.exportAll({ + login: () => _login, + test: () => test, + foo: () => foo, + bar: () => bar + }); +})(); +var $$hmr_login = hmr.exports.login, $$hmr_test = hmr.exports.test, $$hmr_foo = hmr.exports.foo, $$hmr_bar = hmr.exports.bar; +hmr._update = function(exports) { + $$hmr_login = exports.login; + $$hmr_test = exports.test; + $$hmr_foo = exports.foo; + $$hmr_bar = exports.bar; +}; +export { + $$hmr_login as login, + $$hmr_test as test, + $$hmr_foo as foo, + $$hmr_bar as bar +}; diff --git a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js index 53bb66b5e..783769a85 100644 --- a/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js @@ -1,38 +1,12 @@ -import { -__require as require -} from "http://localhost:8080/__runtime.js"; -import { -__cJS2eSM -} from "http://localhost:8080/__runtime.js"; -import * as _login_b977_0 from "http://localhost:8080/_login.js"; -import * as _login_b977_1 from "http://localhost:8080/_login.js"; import _login from "http://localhost:8080/_login.js"; import _auth from "http://localhost:8080/_auth.js"; import * as _loginReally from "http://localhost:8080/_login.js"; import * as _loginReally2 from "http://localhost:8080/_login.js"; import * as _authReally from "http://localhost:8080/_auth.js"; -export default __cJS2eSM(function(module, exports) { - ; - - ; - ; - ; - ; - module.exports.iAmCommonJs = true; - exports.YouAreCommonJS = true; - require(_login_b977_0); - require(_login_b977_1); - Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); - function test() { - return testDone(import.meta.url); - }; -var test = test; - Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); - let foo, bar; - Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, -'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); -}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); - - +export {_login as login}; +export function test() { + return testDone(import.meta.url); +} +export let foo, bar; diff --git a/integration/snapshots/string-escapes.debug.js b/integration/snapshots/string-escapes.debug.js index 890d8355d..4a5c82b05 100644 --- a/integration/snapshots/string-escapes.debug.js +++ b/integration/snapshots/string-escapes.debug.js @@ -18,6 +18,7 @@ var obj = { "\v": "\v", "\u2028": "\u2028", "\u2029": "\u2029", + "\0": "\0\xA0null byte", "😊": "😊", "😃": "😃", "🕵🏽♂️": "🕵🏽♂️", @@ -121,6 +122,35 @@ const correctEncodedObj = [ 34, 44, 34, + 92, + 117, + 48, + 48, + 48, + 48, + 34, + 58, + 34, + 92, + 117, + 48, + 48, + 48, + 48, + 194, + 160, + 110, + 117, + 108, + 108, + 32, + 98, + 121, + 116, + 101, + 34, + 44, + 34, 240, 159, 152, diff --git a/integration/snapshots/string-escapes.hmr.debug.js b/integration/snapshots/string-escapes.hmr.debug.js index 979c5da7e..7a2d88ad1 100644 --- a/integration/snapshots/string-escapes.hmr.debug.js +++ b/integration/snapshots/string-escapes.hmr.debug.js @@ -27,6 +27,7 @@ var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; "\v": "\v", "\u2028": "\u2028", "\u2029": "\u2029", + "\0": "\0\xA0null byte", "😊": "😊", "😃": "😃", "🕵🏽♂️": "🕵🏽♂️", @@ -130,6 +131,35 @@ var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; 34, 44, 34, + 92, + 117, + 48, + 48, + 48, + 48, + 34, + 58, + 34, + 92, + 117, + 48, + 48, + 48, + 48, + 194, + 160, + 110, + 117, + 108, + 108, + 32, + 98, + 121, + 116, + 101, + 34, + 44, + 34, 240, 159, 152, diff --git a/integration/snapshots/string-escapes.hmr.js b/integration/snapshots/string-escapes.hmr.js index ef03d89e1..53f3ba24a 100644 --- a/integration/snapshots/string-escapes.hmr.js +++ b/integration/snapshots/string-escapes.hmr.js @@ -27,6 +27,7 @@ var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; "\v": "\v", "\u2028": "\u2028", "\u2029": "\u2029", + "\0": "\0\xA0null byte", "😊": "😊", "😃": "😃", "🕵🏽♂️": "🕵🏽♂️", @@ -130,6 +131,35 @@ var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; 34, 44, 34, + 92, + 117, + 48, + 48, + 48, + 48, + 34, + 58, + 34, + 92, + 117, + 48, + 48, + 48, + 48, + 194, + 160, + 110, + 117, + 108, + 108, + 32, + 98, + 121, + 116, + 101, + 34, + 44, + 34, 240, 159, 152, diff --git a/integration/snapshots/string-escapes.js b/integration/snapshots/string-escapes.js index 890d8355d..4a5c82b05 100644 --- a/integration/snapshots/string-escapes.js +++ b/integration/snapshots/string-escapes.js @@ -18,6 +18,7 @@ var obj = { "\v": "\v", "\u2028": "\u2028", "\u2029": "\u2029", + "\0": "\0\xA0null byte", "😊": "😊", "😃": "😃", "🕵🏽♂️": "🕵🏽♂️", @@ -121,6 +122,35 @@ const correctEncodedObj = [ 34, 44, 34, + 92, + 117, + 48, + 48, + 48, + 48, + 34, + 58, + 34, + 92, + 117, + 48, + 48, + 48, + 48, + 194, + 160, + 110, + 117, + 108, + 108, + 32, + 98, + 121, + 116, + 101, + 34, + 44, + 34, 240, 159, 152, diff --git a/integration/snapshots/styledcomponents-output.debug.js b/integration/snapshots/styledcomponents-output.debug.js index 0f81a0ba7..b99d434da 100644 --- a/integration/snapshots/styledcomponents-output.debug.js +++ b/integration/snapshots/styledcomponents-output.debug.js @@ -40,18 +40,21 @@ const ErrorScreenRoot = styled.div` `; export function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render(jsx(ErrorScreenRoot, { - id: "error-el", - children: "The react child should have this text" - }, undefined, false, undefined, this), reactEl); - const style = document.querySelector("style[data-styled]"); - console.assert(style, "style tag should exist"); - console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); - console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); - ReactDOM.unmountComponentAtNode(reactEl); - reactEl.remove(); - style.remove(); - testDone(import.meta.url); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render(jsx(ErrorScreenRoot, { + id: "error-el", + children: "The react child should have this text" + }, undefined, false, undefined, this), reactEl); + const style = document.querySelector("style[data-styled]"); + console.assert(style, "style tag should exist"); + console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); + console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + return testDone(import.meta.url); } diff --git a/integration/snapshots/styledcomponents-output.hmr.debug.js b/integration/snapshots/styledcomponents-output.hmr.debug.js index c10d1c492..dc9e2de7d 100644 --- a/integration/snapshots/styledcomponents-output.hmr.debug.js +++ b/integration/snapshots/styledcomponents-output.hmr.debug.js @@ -49,20 +49,23 @@ var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.expor } `; function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render(jsx(ErrorScreenRoot, { - id: "error-el", - children: "The react child should have this text" - }, undefined, false, undefined, this), reactEl); - const style = document.querySelector("style[data-styled]"); - console.assert(style, "style tag should exist"); - console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); - console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); - ReactDOM.unmountComponentAtNode(reactEl); - reactEl.remove(); - style.remove(); - testDone(import.meta.url); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render(jsx(ErrorScreenRoot, { + id: "error-el", + children: "The react child should have this text" + }, undefined, false, undefined, this), reactEl); + const style = document.querySelector("style[data-styled]"); + console.assert(style, "style tag should exist"); + console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); + console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + return testDone(import.meta.url); } hmr.exportAll({ test: () => test diff --git a/integration/snapshots/styledcomponents-output.hmr.js b/integration/snapshots/styledcomponents-output.hmr.js index e451ae202..5f0d525a4 100644 --- a/integration/snapshots/styledcomponents-output.hmr.js +++ b/integration/snapshots/styledcomponents-output.hmr.js @@ -49,20 +49,23 @@ var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.expor } `; function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render(jsx(ErrorScreenRoot, { - id: "error-el", - children: "The react child should have this text" - }, undefined, false, undefined, this), reactEl); - const style = document.querySelector("style[data-styled]"); - console.assert(style, "style tag should exist"); - console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); - console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); - ReactDOM.unmountComponentAtNode(reactEl); - reactEl.remove(); - style.remove(); - testDone(import.meta.url); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render(jsx(ErrorScreenRoot, { + id: "error-el", + children: "The react child should have this text" + }, undefined, false, undefined, this), reactEl); + const style = document.querySelector("style[data-styled]"); + console.assert(style, "style tag should exist"); + console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); + console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + return testDone(import.meta.url); } hmr.exportAll({ test: () => test diff --git a/integration/snapshots/styledcomponents-output.js b/integration/snapshots/styledcomponents-output.js index 0f81a0ba7..b99d434da 100644 --- a/integration/snapshots/styledcomponents-output.js +++ b/integration/snapshots/styledcomponents-output.js @@ -40,18 +40,21 @@ const ErrorScreenRoot = styled.div` `; export function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render(jsx(ErrorScreenRoot, { - id: "error-el", - children: "The react child should have this text" - }, undefined, false, undefined, this), reactEl); - const style = document.querySelector("style[data-styled]"); - console.assert(style, "style tag should exist"); - console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); - console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); - ReactDOM.unmountComponentAtNode(reactEl); - reactEl.remove(); - style.remove(); - testDone(import.meta.url); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render(jsx(ErrorScreenRoot, { + id: "error-el", + children: "The react child should have this text" + }, undefined, false, undefined, this), reactEl); + const style = document.querySelector("style[data-styled]"); + console.assert(style, "style tag should exist"); + console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); + console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + return testDone(import.meta.url); } |