diff options
30 files changed, 226 insertions, 129 deletions
diff --git a/integration/snapshots/array-args-with-default-values.hmr.js b/integration/snapshots/array-args-with-default-values.hmr.js index aae356eed..ba630914e 100644 --- a/integration/snapshots/array-args-with-default-values.hmr.js +++ b/integration/snapshots/array-args-with-default-values.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(3474597122, "array-args-with-default-values.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/bundled-entry-point.hmr.js b/integration/snapshots/bundled-entry-point.hmr.js index f3008327a..ecd58f27f 100644 --- a/integration/snapshots/bundled-entry-point.hmr.js +++ b/integration/snapshots/bundled-entry-point.hmr.js @@ -1,14 +1,14 @@ import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +Bun.activate(true); var hmr = new HMR(3012834585, "bundled-entry-point.js"), exports = hmr.exports; (hmr._load = function() { 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 ef0bd004e..1b0145778 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,15 +1,15 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.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); +} from "http://localhost:3000/__runtime.js"; +import _login from "http://localhost:3000/_login.js"; +import _auth from "http://localhost:3000/_auth.js"; +import * as _loginReally from "http://localhost:3000/_login.js"; +import * as _loginReally2 from "http://localhost:3000/_login.js"; +import * as _authReally from "http://localhost:3000/_auth.js"; +Bun.activate(true); var hmr = new HMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/code-simplification-neql-define.hmr.js b/integration/snapshots/code-simplification-neql-define.hmr.js index 1e517c533..f4b3cd867 100644 --- a/integration/snapshots/code-simplification-neql-define.hmr.js +++ b/integration/snapshots/code-simplification-neql-define.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(726376257, "code-simplification-neql-define.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/custom-emotion-jsx/file.hmr.jsx b/integration/snapshots/custom-emotion-jsx/file.hmr.jsx index da190ef0d..cde211e91 100644 --- a/integration/snapshots/custom-emotion-jsx/file.hmr.jsx +++ b/integration/snapshots/custom-emotion-jsx/file.hmr.jsx @@ -1,18 +1,18 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; var jsx = require(JSX).jsxDEV; -import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js"; +import * as $5b3cea55 from "http://localhost:3000/node_modules/react-dom/index.js"; var ReactDOM = require($5b3cea55); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2497996991, "custom-emotion-jsx/file.jsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/export.hmr.js b/integration/snapshots/export.hmr.js index 6088ffd77..dd99103b5 100644 --- a/integration/snapshots/export.hmr.js +++ b/integration/snapshots/export.hmr.js @@ -1,12 +1,12 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -import what from "http://localhost:8080/_auth.js"; -import * as where from "http://localhost:8080/_auth.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +import what from "http://localhost:3000/_auth.js"; +import * as where from "http://localhost:3000/_auth.js"; +Bun.activate(true); var hmr = new HMR(1879780259, "export.js"), exports = hmr.exports; (hmr._load = function() { @@ -68,7 +68,7 @@ export { $$hmr_booop as booop, $$hmr_test as test }; -export {default as auth} from "http://localhost:8080/_auth.js"; -export {default as login} from "http://localhost:8080/_login.js"; -export * from "http://localhost:8080/_bacon.js"; -export {} from "http://localhost:8080/_bacon.js"; +export {default as auth} from "http://localhost:3000/_auth.js"; +export {default as login} from "http://localhost:3000/_login.js"; +export * from "http://localhost:3000/_bacon.js"; +export {} from "http://localhost:3000/_bacon.js"; diff --git a/integration/snapshots/forbid-in-is-correct.hmr.js b/integration/snapshots/forbid-in-is-correct.hmr.js index bd20b7b42..2f15a5c4e 100644 --- a/integration/snapshots/forbid-in-is-correct.hmr.js +++ b/integration/snapshots/forbid-in-is-correct.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(346837007, "forbid-in-is-correct.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/global-is-remapped-to-globalThis.hmr.js b/integration/snapshots/global-is-remapped-to-globalThis.hmr.js index a5a3723a6..ecf6b285a 100644 --- a/integration/snapshots/global-is-remapped-to-globalThis.hmr.js +++ b/integration/snapshots/global-is-remapped-to-globalThis.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(713665787, "global-is-remapped-to-globalThis.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/jsx-entities.hmr.debug.jsx b/integration/snapshots/jsx-entities.hmr.debug.jsx index 9bb00ff8d..73f00bdef 100644 --- a/integration/snapshots/jsx-entities.hmr.debug.jsx +++ b/integration/snapshots/jsx-entities.hmr.debug.jsx @@ -918,7 +918,7 @@ var hmr = new HMR(817082122, "jsx-entities.jsx"), exports = hmr.exports; children: "." }, undefined, false, undefined, this))]: 46, [ReactDOM.renderToString(jsx(JSXFrag, { - children: "\x2F" + children: "/" }, undefined, false, undefined, this))]: 47, [ReactDOM.renderToString(jsx(JSXFrag, { children: "0" diff --git a/integration/snapshots/jsx-entities.hmr.jsx b/integration/snapshots/jsx-entities.hmr.jsx index 2ec3158d6..0eb36afd9 100644 --- a/integration/snapshots/jsx-entities.hmr.jsx +++ b/integration/snapshots/jsx-entities.hmr.jsx @@ -1,20 +1,20 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; -import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js"; +import * as $1f6f0e67 from "http://localhost:3000/node_modules/react-dom/server.browser.js"; var ReactDOM = require($1f6f0e67); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(817082122, "jsx-entities.jsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/jsx-spacing.hmr.jsx b/integration/snapshots/jsx-spacing.hmr.jsx index d41bc53c7..5a5ded7d0 100644 --- a/integration/snapshots/jsx-spacing.hmr.jsx +++ b/integration/snapshots/jsx-spacing.hmr.jsx @@ -1,18 +1,18 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; var jsx = require(JSX).jsxDEV; -import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js"; +import * as $1f6f0e67 from "http://localhost:3000/node_modules/react-dom/server.browser.js"; var ReactDOM = require($1f6f0e67); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(3614189736, "jsx-spacing.jsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/latin1-chars-in-regexp.hmr.js b/integration/snapshots/latin1-chars-in-regexp.hmr.js index 03b9344e4..f0ef69cfd 100644 --- a/integration/snapshots/latin1-chars-in-regexp.hmr.js +++ b/integration/snapshots/latin1-chars-in-regexp.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(1430071586, "latin1-chars-in-regexp.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/lodash-regexp.hmr.js b/integration/snapshots/lodash-regexp.hmr.js index cd9ca40f7..8a4c1854b 100644 --- a/integration/snapshots/lodash-regexp.hmr.js +++ b/integration/snapshots/lodash-regexp.hmr.js @@ -1,15 +1,15 @@ import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; +} from "http://localhost:3000/__runtime.js"; +import * as $60f52dc2 from "http://localhost:3000/node_modules/lodash/lodash.js"; var { shuffle} = require($60f52dc2); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2158065009, "lodash-regexp.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/multiple-imports.hmr.js b/integration/snapshots/multiple-imports.hmr.js index 03cfe9d1a..a303d7a74 100644 --- a/integration/snapshots/multiple-imports.hmr.js +++ b/integration/snapshots/multiple-imports.hmr.js @@ -1,20 +1,20 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; var { default: React} = require($bbcd215f); var { default: React2} = require($bbcd215f); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2165509932, "multiple-imports.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/number-literal-bug.hmr.debug.js b/integration/snapshots/number-literal-bug.hmr.debug.js new file mode 100644 index 000000000..e9d9f7b06 --- /dev/null +++ b/integration/snapshots/number-literal-bug.hmr.debug.js @@ -0,0 +1,31 @@ +import { +__HMRModule as HMR +} from "http://localhost:8080/__runtime.js"; +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +Bun.activate(true); + +var hmr = new HMR(583570002, "number-literal-bug.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + const precision = 10; + try { + parseFloat(0 .toPrecision(precision) + "1"); + } catch (exception) { + throw new Error("Test Failed", exception); + } + testDone(import.meta.url); + } + hmr.exportAll({ + test: () => test + }); +})(); +var $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_test = exports.test; +}; + +export { + $$hmr_test as test +}; diff --git a/integration/snapshots/number-literal-bug.hmr.js b/integration/snapshots/number-literal-bug.hmr.js index 87cd08433..23c6b1405 100644 --- a/integration/snapshots/number-literal-bug.hmr.js +++ b/integration/snapshots/number-literal-bug.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(583570002, "number-literal-bug.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/optional-chain-with-function.hmr.debug.js b/integration/snapshots/optional-chain-with-function.hmr.debug.js index 5bf65a6f8..acd656901 100644 --- a/integration/snapshots/optional-chain-with-function.hmr.debug.js +++ b/integration/snapshots/optional-chain-with-function.hmr.debug.js @@ -13,9 +13,9 @@ var hmr = new HMR(3608848620, "optional-chain-with-function.js"), exports = hmr. const multipleSecondaryValues = undefined; const ratings = ["123"]; var bar = multipleSecondaryValues?.map((value) => false); - bar = (bar?.multipleSecondaryValues)?.map((value) => false); - bar = (bar?.bar?.multipleSecondaryValues)?.map((value) => false); - bar = ({}?.bar?.multipleSecondaryValues)?.map((value) => false); + bar = bar?.multipleSecondaryValues?.map((value) => false); + bar = bar?.bar?.multipleSecondaryValues?.map((value) => false); + bar = {}?.bar?.multipleSecondaryValues?.map((value) => false); } catch (e) { throw e; } diff --git a/integration/snapshots/optional-chain-with-function.hmr.js b/integration/snapshots/optional-chain-with-function.hmr.js index 91666bf96..50852ae3c 100644 --- a/integration/snapshots/optional-chain-with-function.hmr.js +++ b/integration/snapshots/optional-chain-with-function.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(3608848620, "optional-chain-with-function.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/package-json-exports/index.hmr.js b/integration/snapshots/package-json-exports/index.hmr.js index d4e1aff18..14b31615f 100644 --- a/integration/snapshots/package-json-exports/index.hmr.js +++ b/integration/snapshots/package-json-exports/index.hmr.js @@ -1,21 +1,21 @@ import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -import * as $4068f25b from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js"; +} from "http://localhost:3000/__runtime.js"; +import * as $4068f25b from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/index.js"; var InexactRoot = require($4068f25b); -import * as $d2a171d2 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js"; +import * as $d2a171d2 from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/dir/file.js"; var InexactFile = require($d2a171d2); -import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js"; +import * as $522c6d1f from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/foo.js"; var ExactFile = require($522c6d1f); -import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js"; +import * as $fce83cd7 from "http://localhost:3000/package-json-exports/node_modules/js-only-exports/browser/js-file.js"; var JSFileExtensionOnly = require($fce83cd7); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/react-context-value-func.hmr.tsx b/integration/snapshots/react-context-value-func.hmr.tsx index c6313661e..ce8a4fd15 100644 --- a/integration/snapshots/react-context-value-func.hmr.tsx +++ b/integration/snapshots/react-context-value-func.hmr.tsx @@ -1,18 +1,18 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; var jsx = require(JSX).jsxDEV; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var { default: React} = require($bbcd215f); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(3514348331, "react-context-value-func.tsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/spread_with_key.hmr.tsx b/integration/snapshots/spread_with_key.hmr.tsx index 4b5d9ccf6..99986b705 100644 --- a/integration/snapshots/spread_with_key.hmr.tsx +++ b/integration/snapshots/spread_with_key.hmr.tsx @@ -1,19 +1,19 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement; var { default: React} = require($bbcd215f); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2717584935, "spread_with_key.tsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/string-escapes.hmr.js b/integration/snapshots/string-escapes.hmr.js index e1f38c7af..1a768075b 100644 --- a/integration/snapshots/string-escapes.hmr.js +++ b/integration/snapshots/string-escapes.hmr.js @@ -1,18 +1,18 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; (hmr._load = function() { var tab = "\t"; diff --git a/integration/snapshots/styledcomponents-output.hmr.js b/integration/snapshots/styledcomponents-output.hmr.js index 5f0d525a4..0d1dbdd7c 100644 --- a/integration/snapshots/styledcomponents-output.hmr.js +++ b/integration/snapshots/styledcomponents-output.hmr.js @@ -1,22 +1,22 @@ import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __require as require -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:3000/__runtime.js"; +import * as JSX from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; var jsx = require(JSX).jsxDEV; -import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js"; +import * as $d4051a2e from "http://localhost:3000/node_modules/styled-components/dist/styled-components.browser.esm.js"; var { default: styled} = require($d4051a2e); -import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; var { default: React} = require($bbcd215f); -import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js"; +import * as $5b3cea55 from "http://localhost:3000/node_modules/react-dom/index.js"; var { default: ReactDOM} = require($5b3cea55); -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/template-literal.hmr.debug.js b/integration/snapshots/template-literal.hmr.debug.js new file mode 100644 index 000000000..af93a6fa5 --- /dev/null +++ b/integration/snapshots/template-literal.hmr.debug.js @@ -0,0 +1,59 @@ +import { +__HMRModule as HMR +} from "http://localhost:8080/__runtime.js"; +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +Bun.activate(true); + +var hmr = new HMR(2201713056, "template-literal.js"), exports = hmr.exports; +(hmr._load = function() { + const css = (templ) => templ.toString(); + const fooNoBracesUTF8 = css` + before + /* */ + after +`; + const fooNoBracesUT16 = css` + before + 🙃 + after +`; + const fooUTF8 = css` + before + ${true} + after + +`; + const fooUTF16 = css` + before + 🙃 ${true} + after + +`; + const templateLiteralWhichDefinesAFunction = ((...args) => args[args.length - 1]().toString())` + before + 🙃 ${() => true} + after + +`; + function test() { + for (let foo of [fooNoBracesUT16, fooNoBracesUTF8, fooUTF16, fooUTF8]) { + console.assert(foo.includes("before"), `Expected ${foo} to include "before"`); + console.assert(foo.includes("after"), `Expected ${foo} to include "after"`); + } + console.assert(templateLiteralWhichDefinesAFunction.includes("true"), "Expected fooFunction to include 'true'"); + return testDone(import.meta.url); + } + hmr.exportAll({ + test: () => test + }); +})(); +var $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_test = exports.test; +}; + +export { + $$hmr_test as test +}; diff --git a/integration/snapshots/template-literal.hmr.js b/integration/snapshots/template-literal.hmr.js index d6a731b50..a7ef232bf 100644 --- a/integration/snapshots/template-literal.hmr.js +++ b/integration/snapshots/template-literal.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(2201713056, "template-literal.js"), exports = hmr.exports; (hmr._load = function() { @@ -31,11 +31,18 @@ var hmr = new HMR(2201713056, "template-literal.js"), exports = hmr.exports; after `; + const templateLiteralWhichDefinesAFunction = ((...args) => args[args.length - 1]().toString())` + before + 🙃 ${() => true} + after + +`; function test() { for (let foo of [fooNoBracesUT16, fooNoBracesUTF8, fooUTF16, fooUTF8]) { console.assert(foo.includes("before"), `Expected ${foo} to include "before"`); console.assert(foo.includes("after"), `Expected ${foo} to include "after"`); } + console.assert(templateLiteralWhichDefinesAFunction.includes("true"), "Expected fooFunction to include 'true'"); return testDone(import.meta.url); } hmr.exportAll({ diff --git a/integration/snapshots/ts-fallback-rewrite-works.hmr.js b/integration/snapshots/ts-fallback-rewrite-works.hmr.js index e728c5f14..c235770fd 100644 --- a/integration/snapshots/ts-fallback-rewrite-works.hmr.js +++ b/integration/snapshots/ts-fallback-rewrite-works.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(421762902, "ts-fallback-rewrite-works.ts"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/tsx-fallback-rewrite-works.hmr.js b/integration/snapshots/tsx-fallback-rewrite-works.hmr.js index 3f2f754e2..8cc25812c 100644 --- a/integration/snapshots/tsx-fallback-rewrite-works.hmr.js +++ b/integration/snapshots/tsx-fallback-rewrite-works.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(2117426367, "tsx-fallback-rewrite-works.tsx"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/type-only-imports.hmr.ts b/integration/snapshots/type-only-imports.hmr.ts index 84740d0d9..e14336a72 100644 --- a/integration/snapshots/type-only-imports.hmr.ts +++ b/integration/snapshots/type-only-imports.hmr.ts @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(650094581, "type-only-imports.ts"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/unicode-identifiers.hmr.js b/integration/snapshots/unicode-identifiers.hmr.js index 5d465d559..18dc3877f 100644 --- a/integration/snapshots/unicode-identifiers.hmr.js +++ b/integration/snapshots/unicode-identifiers.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(1398361736, "unicode-identifiers.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js index 239b40fbd..fe743f652 100644 --- a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js +++ b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js @@ -1,10 +1,10 @@ import { __HMRModule as HMR -} from "http://localhost:8080/__runtime.js"; +} from "http://localhost:3000/__runtime.js"; import { __HMRClient as Bun -} from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +} from "http://localhost:3000/__runtime.js"; +Bun.activate(true); var hmr = new HMR(635901064, "void-shouldnt-delete-call-expressions.js"), exports = hmr.exports; (hmr._load = function() { |