diff options
author | 2022-02-04 01:02:55 -0800 | |
---|---|---|
committer | 2022-02-04 01:02:55 -0800 | |
commit | b2b8c7f0b73cd9a4f46f4a801100294152c2d4bd (patch) | |
tree | d9b635830dc6f56f1c7ddd705287048c089b0ea6 | |
parent | 29554f4de328cad377f9dfbe799ac62876ad03a3 (diff) | |
download | bun-b2b8c7f0b73cd9a4f46f4a801100294152c2d4bd.tar.gz bun-b2b8c7f0b73cd9a4f46f4a801100294152c2d4bd.tar.zst bun-b2b8c7f0b73cd9a4f46f4a801100294152c2d4bd.zip |
:camera:
74 files changed, 669 insertions, 340 deletions
diff --git a/integration/snapshots/array-args-with-default-values.hmr.debug.js b/integration/snapshots/array-args-with-default-values.hmr.debug.js index f55cb290e..e52851747 100644 --- a/integration/snapshots/array-args-with-default-values.hmr.debug.js +++ b/integration/snapshots/array-args-with-default-values.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(3474597122, "array-args-with-default-values.js"), exports = hmr.exports; +var hmr = new FastHMR(3474597122, "array-args-with-default-values.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var lines; const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({ diff --git a/integration/snapshots/array-args-with-default-values.hmr.js b/integration/snapshots/array-args-with-default-values.hmr.js index 467ccd733..a33f4c030 100644 --- a/integration/snapshots/array-args-with-default-values.hmr.js +++ b/integration/snapshots/array-args-with-default-values.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(3474597122, "array-args-with-default-values.js"), exports = hmr.exports; +var hmr = new FastHMR(3474597122, "array-args-with-default-values.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var lines; const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({ diff --git a/integration/snapshots/bundled-entry-point.debug.js b/integration/snapshots/bundled-entry-point.debug.js index 0ffe267f1..512d886be 100644 --- a/integration/snapshots/bundled-entry-point.debug.js +++ b/integration/snapshots/bundled-entry-point.debug.js @@ -1,6 +1,6 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var hello = null ?? "world"; diff --git a/integration/snapshots/bundled-entry-point.hmr.debug.js b/integration/snapshots/bundled-entry-point.hmr.debug.js index 4b62d3dbc..d08f23138 100644 --- a/integration/snapshots/bundled-entry-point.hmr.debug.js +++ b/integration/snapshots/bundled-entry-point.hmr.debug.js @@ -1,16 +1,19 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; Bun.activate(true); -var hmr = new HMR(3012834585, "bundled-entry-point.js"), exports = hmr.exports; +var hmr = new FastHMR(3012834585, "bundled-entry-point.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var hello = null ?? "world"; function test() { diff --git a/integration/snapshots/bundled-entry-point.hmr.js b/integration/snapshots/bundled-entry-point.hmr.js index 30a619535..071e573e8 100644 --- a/integration/snapshots/bundled-entry-point.hmr.js +++ b/integration/snapshots/bundled-entry-point.hmr.js @@ -1,16 +1,19 @@ import { __require as require -} from "http://localhost:3000/bun:wrap"; -import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +Bun.activate(false); -var hmr = new HMR(3012834585, "bundled-entry-point.js"), exports = hmr.exports; +var hmr = new FastHMR(3012834585, "bundled-entry-point.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var hello = null ?? "world"; function test() { diff --git a/integration/snapshots/caught-require.debug.js b/integration/snapshots/caught-require.debug.js index f4f12c29d..2ac200f3d 100644 --- a/integration/snapshots/caught-require.debug.js +++ b/integration/snapshots/caught-require.debug.js @@ -1,6 +1,6 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; try { require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )()); diff --git a/integration/snapshots/caught-require.hmr.debug.js b/integration/snapshots/caught-require.hmr.debug.js index 7144220d8..1a7114694 100644 --- a/integration/snapshots/caught-require.hmr.debug.js +++ b/integration/snapshots/caught-require.hmr.debug.js @@ -2,14 +2,17 @@ import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(2398506918, "caught-require.js"), exports = hmr.exports; +var hmr = new FastHMR(2398506918, "caught-require.js", FastRefresh), exports = hmr.exports; await (hmr._load = async function() { try { require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )()); diff --git a/integration/snapshots/caught-require.hmr.js b/integration/snapshots/caught-require.hmr.js index 57f98636c..3202a500d 100644 --- a/integration/snapshots/caught-require.hmr.js +++ b/integration/snapshots/caught-require.hmr.js @@ -1,15 +1,18 @@ import { __require as require -} from "http://localhost:3000/bun:wrap"; -import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(2398506918, "caught-require.js"), exports = hmr.exports; +var hmr = new FastHMR(2398506918, "caught-require.js", FastRefresh), exports = hmr.exports; await (hmr._load = async function() { try { require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )()); 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 c5aa62729..f8455b5dd 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,9 +1,12 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; 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"; @@ -11,7 +14,7 @@ import * as _loginReally2 from "http://localhost:8080/_login.js"; import * as _authReally from "http://localhost:8080/_auth.js"; Bun.activate(true); -var hmr = new HMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"), exports = hmr.exports; +var hmr = new FastHMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { return testDone(import.meta.url); 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 289262c1e..5b492fffc 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,17 +1,20 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -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); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +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); -var hmr = new HMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"), exports = hmr.exports; +var hmr = new FastHMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { return testDone(import.meta.url); diff --git a/integration/snapshots/code-simplification-neql-define.hmr.debug.js b/integration/snapshots/code-simplification-neql-define.hmr.debug.js index 860c514ba..8ffe01c87 100644 --- a/integration/snapshots/code-simplification-neql-define.hmr.debug.js +++ b/integration/snapshots/code-simplification-neql-define.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(726376257, "code-simplification-neql-define.js"), exports = hmr.exports; +var hmr = new FastHMR(726376257, "code-simplification-neql-define.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var testFailed = false; const invariant = () => { diff --git a/integration/snapshots/code-simplification-neql-define.hmr.js b/integration/snapshots/code-simplification-neql-define.hmr.js index c1523ee6e..14e2292e5 100644 --- a/integration/snapshots/code-simplification-neql-define.hmr.js +++ b/integration/snapshots/code-simplification-neql-define.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(726376257, "code-simplification-neql-define.js"), exports = hmr.exports; +var hmr = new FastHMR(726376257, "code-simplification-neql-define.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var testFailed = false; const invariant = () => { diff --git a/integration/snapshots/custom-emotion-jsx/file.debug.jsx b/integration/snapshots/custom-emotion-jsx/file.debug.jsx index 97987ff3f..b86650863 100644 --- a/integration/snapshots/custom-emotion-jsx/file.debug.jsx +++ b/integration/snapshots/custom-emotion-jsx/file.debug.jsx @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -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:8080/bun:wrap"; +import * as $72625799 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; +var JSX = require($72625799); var jsx = require(JSX).jsxDEV; import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js"; diff --git a/integration/snapshots/custom-emotion-jsx/file.hmr.debug.jsx b/integration/snapshots/custom-emotion-jsx/file.hmr.debug.jsx index 896bd2e93..bf1477672 100644 --- a/integration/snapshots/custom-emotion-jsx/file.hmr.debug.jsx +++ b/integration/snapshots/custom-emotion-jsx/file.hmr.debug.jsx @@ -1,11 +1,14 @@ import { -__HMRClient as Bun +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR } from "http://localhost:8080/bun:wrap"; import * as $72625799 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; var JSX = require($72625799); @@ -15,7 +18,7 @@ import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.j var ReactDOM = require($5b3cea55); Bun.activate(true); -var hmr = new HMR(2497996991, "custom-emotion-jsx/file.jsx"), exports = hmr.exports; +var hmr = new FastHMR(2497996991, "custom-emotion-jsx/file.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { var Foo = () => jsx("div", { css: {content: '"it worked!"' } diff --git a/integration/snapshots/custom-emotion-jsx/file.hmr.jsx b/integration/snapshots/custom-emotion-jsx/file.hmr.jsx index 398690a7e..b68d5fe48 100644 --- a/integration/snapshots/custom-emotion-jsx/file.hmr.jsx +++ b/integration/snapshots/custom-emotion-jsx/file.hmr.jsx @@ -1,21 +1,24 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $72625799 from "http://localhost:3000/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $72625799 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js"; var JSX = require($72625799); var jsx = require(JSX).jsxDEV; -import * as $5b3cea55 from "http://localhost:3000/node_modules/react-dom/index.js"; +import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js"; var ReactDOM = require($5b3cea55); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(2497996991, "custom-emotion-jsx/file.jsx"), exports = hmr.exports; +var hmr = new FastHMR(2497996991, "custom-emotion-jsx/file.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { var Foo = () => jsx("div", { css: {content: '"it worked!"' } diff --git a/integration/snapshots/export.hmr.debug.js b/integration/snapshots/export.hmr.debug.js index ed800afa1..5f75251f8 100644 --- a/integration/snapshots/export.hmr.debug.js +++ b/integration/snapshots/export.hmr.debug.js @@ -1,14 +1,17 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import what from "http://localhost:8080/_auth.js"; import * as where from "http://localhost:8080/_auth.js"; Bun.activate(true); -var hmr = new HMR(1879780259, "export.js"), exports = hmr.exports; +var hmr = new FastHMR(1879780259, "export.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var yoyoyo = "yoyoyo"; function hey() { diff --git a/integration/snapshots/export.hmr.js b/integration/snapshots/export.hmr.js index ef1963323..83ae33c98 100644 --- a/integration/snapshots/export.hmr.js +++ b/integration/snapshots/export.hmr.js @@ -1,14 +1,17 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -import what from "http://localhost:3000/_auth.js"; -import * as where from "http://localhost:3000/_auth.js"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import what from "http://localhost:8080/_auth.js"; +import * as where from "http://localhost:8080/_auth.js"; +Bun.activate(false); -var hmr = new HMR(1879780259, "export.js"), exports = hmr.exports; +var hmr = new FastHMR(1879780259, "export.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var yoyoyo = "yoyoyo"; function hey() { @@ -68,7 +71,7 @@ export { $$hmr_booop as booop, $$hmr_test as test }; -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"; +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"; diff --git a/integration/snapshots/forbid-in-is-correct.hmr.debug.js b/integration/snapshots/forbid-in-is-correct.hmr.debug.js index e38cadb7f..d7dd7a5bb 100644 --- a/integration/snapshots/forbid-in-is-correct.hmr.debug.js +++ b/integration/snapshots/forbid-in-is-correct.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(346837007, "forbid-in-is-correct.js"), exports = hmr.exports; +var hmr = new FastHMR(346837007, "forbid-in-is-correct.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var foo = () => { var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports); diff --git a/integration/snapshots/forbid-in-is-correct.hmr.js b/integration/snapshots/forbid-in-is-correct.hmr.js index 2b55a976a..5101cde52 100644 --- a/integration/snapshots/forbid-in-is-correct.hmr.js +++ b/integration/snapshots/forbid-in-is-correct.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(346837007, "forbid-in-is-correct.js"), exports = hmr.exports; +var hmr = new FastHMR(346837007, "forbid-in-is-correct.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var foo = () => { var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports); diff --git a/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js b/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js index c2a6edc5f..14199f271 100644 --- a/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js +++ b/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(713665787, "global-is-remapped-to-globalThis.js"), exports = hmr.exports; +var hmr = new FastHMR(713665787, "global-is-remapped-to-globalThis.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { console.assert(globalThis === globalThis); diff --git a/integration/snapshots/global-is-remapped-to-globalThis.hmr.js b/integration/snapshots/global-is-remapped-to-globalThis.hmr.js index 6872df8ca..379d5ea5d 100644 --- a/integration/snapshots/global-is-remapped-to-globalThis.hmr.js +++ b/integration/snapshots/global-is-remapped-to-globalThis.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(713665787, "global-is-remapped-to-globalThis.js"), exports = hmr.exports; +var hmr = new FastHMR(713665787, "global-is-remapped-to-globalThis.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { console.assert(globalThis === globalThis); diff --git a/integration/snapshots/jsx-entities.debug.jsx b/integration/snapshots/jsx-entities.debug.jsx index 63128a105..29ca5356c 100644 --- a/integration/snapshots/jsx-entities.debug.jsx +++ b/integration/snapshots/jsx-entities.debug.jsx @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; diff --git a/integration/snapshots/jsx-entities.hmr.debug.jsx b/integration/snapshots/jsx-entities.hmr.debug.jsx index 4c4e6ac85..817eb5481 100644 --- a/integration/snapshots/jsx-entities.hmr.debug.jsx +++ b/integration/snapshots/jsx-entities.hmr.debug.jsx @@ -1,11 +1,14 @@ import { -__HMRClient as Bun +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR } from "http://localhost:8080/bun:wrap"; import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); @@ -17,7 +20,7 @@ import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server. var ReactDOM = require($1f6f0e67); Bun.activate(true); -var hmr = new HMR(817082122, "jsx-entities.jsx"), exports = hmr.exports; +var hmr = new FastHMR(817082122, "jsx-entities.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const elements = { [ReactDOM.renderToString(jsx(JSXFrag, { diff --git a/integration/snapshots/jsx-entities.hmr.jsx b/integration/snapshots/jsx-entities.hmr.jsx index f7e3df0b0..c3f351a9f 100644 --- a/integration/snapshots/jsx-entities.hmr.jsx +++ b/integration/snapshots/jsx-entities.hmr.jsx @@ -1,23 +1,26 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; -import * as $1f6f0e67 from "http://localhost:3000/node_modules/react-dom/server.browser.js"; +import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js"; var ReactDOM = require($1f6f0e67); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(817082122, "jsx-entities.jsx"), exports = hmr.exports; +var hmr = new FastHMR(817082122, "jsx-entities.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const elements = { [ReactDOM.renderToString(jsx(JSXFrag, { diff --git a/integration/snapshots/jsx-spacing.debug.jsx b/integration/snapshots/jsx-spacing.debug.jsx index 29c8995d3..50ad5cf88 100644 --- a/integration/snapshots/jsx-spacing.debug.jsx +++ b/integration/snapshots/jsx-spacing.debug.jsx @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js"; diff --git a/integration/snapshots/jsx-spacing.hmr.debug.jsx b/integration/snapshots/jsx-spacing.hmr.debug.jsx index d82957a7a..e25227b41 100644 --- a/integration/snapshots/jsx-spacing.hmr.debug.jsx +++ b/integration/snapshots/jsx-spacing.hmr.debug.jsx @@ -1,11 +1,14 @@ import { -__HMRClient as Bun +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR } from "http://localhost:8080/bun:wrap"; import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); @@ -15,7 +18,7 @@ import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server. var ReactDOM = require($1f6f0e67); Bun.activate(true); -var hmr = new HMR(3614189736, "jsx-spacing.jsx"), exports = hmr.exports; +var hmr = new FastHMR(3614189736, "jsx-spacing.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const ReturnDescriptionAsString = ({ description }) => description; function test() { diff --git a/integration/snapshots/jsx-spacing.hmr.jsx b/integration/snapshots/jsx-spacing.hmr.jsx index c6eb4b979..2d7c15886 100644 --- a/integration/snapshots/jsx-spacing.hmr.jsx +++ b/integration/snapshots/jsx-spacing.hmr.jsx @@ -1,21 +1,24 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; -import * as $1f6f0e67 from "http://localhost:3000/node_modules/react-dom/server.browser.js"; +import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js"; var ReactDOM = require($1f6f0e67); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(3614189736, "jsx-spacing.jsx"), exports = hmr.exports; +var hmr = new FastHMR(3614189736, "jsx-spacing.jsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const ReturnDescriptionAsString = ({ description }) => description; function test() { diff --git a/integration/snapshots/latin1-chars-in-regexp.hmr.debug.js b/integration/snapshots/latin1-chars-in-regexp.hmr.debug.js index 29ce11711..64a95f458 100644 --- a/integration/snapshots/latin1-chars-in-regexp.hmr.debug.js +++ b/integration/snapshots/latin1-chars-in-regexp.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(1430071586, "latin1-chars-in-regexp.js"), exports = hmr.exports; +var hmr = new FastHMR(1430071586, "latin1-chars-in-regexp.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; diff --git a/integration/snapshots/latin1-chars-in-regexp.hmr.js b/integration/snapshots/latin1-chars-in-regexp.hmr.js index 5baf94817..f92b8f153 100644 --- a/integration/snapshots/latin1-chars-in-regexp.hmr.js +++ b/integration/snapshots/latin1-chars-in-regexp.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(1430071586, "latin1-chars-in-regexp.js"), exports = hmr.exports; +var hmr = new FastHMR(1430071586, "latin1-chars-in-regexp.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; diff --git a/integration/snapshots/lodash-regexp.debug.js b/integration/snapshots/lodash-regexp.debug.js index dd6bca362..4214dd6ef 100644 --- a/integration/snapshots/lodash-regexp.debug.js +++ b/integration/snapshots/lodash-regexp.debug.js @@ -1,6 +1,6 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; var { shuffle} = require($60f52dc2); export function test() { diff --git a/integration/snapshots/lodash-regexp.hmr.debug.js b/integration/snapshots/lodash-regexp.hmr.debug.js index a66de3069..1e3b52e4d 100644 --- a/integration/snapshots/lodash-regexp.hmr.debug.js +++ b/integration/snapshots/lodash-regexp.hmr.debug.js @@ -1,17 +1,20 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; var { shuffle} = require($60f52dc2); Bun.activate(true); -var hmr = new HMR(2158065009, "lodash-regexp.js"), exports = hmr.exports; +var hmr = new FastHMR(2158065009, "lodash-regexp.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { const foo = [1, 2, 3, 4, 6]; diff --git a/integration/snapshots/lodash-regexp.hmr.js b/integration/snapshots/lodash-regexp.hmr.js index 78e5609af..46424c795 100644 --- a/integration/snapshots/lodash-regexp.hmr.js +++ b/integration/snapshots/lodash-regexp.hmr.js @@ -1,17 +1,20 @@ import { __require as require -} from "http://localhost:3000/bun:wrap"; -import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -import * as $60f52dc2 from "http://localhost:3000/node_modules/lodash/lodash.js"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; var { shuffle} = require($60f52dc2); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(2158065009, "lodash-regexp.js"), exports = hmr.exports; +var hmr = new FastHMR(2158065009, "lodash-regexp.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { const foo = [1, 2, 3, 4, 6]; diff --git a/integration/snapshots/multiple-imports.debug.js b/integration/snapshots/multiple-imports.debug.js index dcf7b6231..cbbd22839 100644 --- a/integration/snapshots/multiple-imports.debug.js +++ b/integration/snapshots/multiple-imports.debug.js @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; diff --git a/integration/snapshots/multiple-imports.hmr.debug.js b/integration/snapshots/multiple-imports.hmr.debug.js index 78cf5bd0e..a21f8f34d 100644 --- a/integration/snapshots/multiple-imports.hmr.debug.js +++ b/integration/snapshots/multiple-imports.hmr.debug.js @@ -1,13 +1,17 @@ import { -__HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; @@ -16,7 +20,7 @@ var { default: React} = require($bbcd215f); var { default: React2} = require($bbcd215f); Bun.activate(true); -var hmr = new HMR(2165509932, "multiple-imports.js"), exports = hmr.exports; +var hmr = new FastHMR(2165509932, "multiple-imports.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const bacon = React; const bacon2 = jsx(JSXFrag, { diff --git a/integration/snapshots/multiple-imports.hmr.js b/integration/snapshots/multiple-imports.hmr.js index 8945c5424..42e629585 100644 --- a/integration/snapshots/multiple-imports.hmr.js +++ b/integration/snapshots/multiple-imports.hmr.js @@ -1,23 +1,26 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/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(true); +Bun.activate(false); -var hmr = new HMR(2165509932, "multiple-imports.js"), exports = hmr.exports; +var hmr = new FastHMR(2165509932, "multiple-imports.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const bacon = React; const bacon2 = jsx(JSXFrag, { diff --git a/integration/snapshots/multiple-var.debug.js b/integration/snapshots/multiple-var.debug.js new file mode 100644 index 000000000..1861aacf7 --- /dev/null +++ b/integration/snapshots/multiple-var.debug.js @@ -0,0 +1,11 @@ +var foo = true; +globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT = true; +if (globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT) + ({ + foo + } = {foo: false }); +export function test() { + console.assert(foo === false, "foo should be false"); + return testDone(import.meta.url); +} +var foo; diff --git a/integration/snapshots/multiple-var.hmr.debug.js b/integration/snapshots/multiple-var.hmr.debug.js new file mode 100644 index 000000000..0987b9ab0 --- /dev/null +++ b/integration/snapshots/multiple-var.hmr.debug.js @@ -0,0 +1,36 @@ +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(true); + +var hmr = new FastHMR(2883558553, "multiple-var.js", FastRefresh), exports = hmr.exports; +(hmr._load = function() { + var foo = true; + globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT = true; + if (globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT) + ({ + foo + } = {foo: false }); + function test() { + console.assert(foo === false, "foo should be false"); + return testDone(import.meta.url); + } + var foo; + 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/multiple-var.hmr.js b/integration/snapshots/multiple-var.hmr.js new file mode 100644 index 000000000..7b717f25f --- /dev/null +++ b/integration/snapshots/multiple-var.hmr.js @@ -0,0 +1,36 @@ +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); + +var hmr = new FastHMR(2883558553, "multiple-var.js", FastRefresh), exports = hmr.exports; +(hmr._load = function() { + var foo = true; + globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT = true; + if (globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT) + ({ + foo + } = {foo: false }); + function test() { + console.assert(foo === false, "foo should be false"); + return testDone(import.meta.url); + } + var foo; + 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/multiple-var.js b/integration/snapshots/multiple-var.js new file mode 100644 index 000000000..1861aacf7 --- /dev/null +++ b/integration/snapshots/multiple-var.js @@ -0,0 +1,11 @@ +var foo = true; +globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT = true; +if (globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT) + ({ + foo + } = {foo: false }); +export function test() { + console.assert(foo === false, "foo should be false"); + return testDone(import.meta.url); +} +var foo; diff --git a/integration/snapshots/number-literal-bug.hmr.debug.js b/integration/snapshots/number-literal-bug.hmr.debug.js index 81dd56694..1fcb8d890 100644 --- a/integration/snapshots/number-literal-bug.hmr.debug.js +++ b/integration/snapshots/number-literal-bug.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(583570002, "number-literal-bug.js"), exports = hmr.exports; +var hmr = new FastHMR(583570002, "number-literal-bug.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { const precision = 10; diff --git a/integration/snapshots/number-literal-bug.hmr.js b/integration/snapshots/number-literal-bug.hmr.js index f83254c0d..40f33fc7f 100644 --- a/integration/snapshots/number-literal-bug.hmr.js +++ b/integration/snapshots/number-literal-bug.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(583570002, "number-literal-bug.js"), exports = hmr.exports; +var hmr = new FastHMR(583570002, "number-literal-bug.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { const precision = 10; diff --git a/integration/snapshots/optional-chain-with-function.hmr.debug.js b/integration/snapshots/optional-chain-with-function.hmr.debug.js index 68b71ddcc..c6c904ea7 100644 --- a/integration/snapshots/optional-chain-with-function.hmr.debug.js +++ b/integration/snapshots/optional-chain-with-function.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(3608848620, "optional-chain-with-function.js"), exports = hmr.exports; +var hmr = new FastHMR(3608848620, "optional-chain-with-function.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { try { diff --git a/integration/snapshots/optional-chain-with-function.hmr.js b/integration/snapshots/optional-chain-with-function.hmr.js index b75166c90..3be7790c2 100644 --- a/integration/snapshots/optional-chain-with-function.hmr.js +++ b/integration/snapshots/optional-chain-with-function.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(3608848620, "optional-chain-with-function.js"), exports = hmr.exports; +var hmr = new FastHMR(3608848620, "optional-chain-with-function.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { try { diff --git a/integration/snapshots/package-json-exports/index.debug.js b/integration/snapshots/package-json-exports/index.debug.js index cfeee9a4a..c404afc32 100644 --- a/integration/snapshots/package-json-exports/index.debug.js +++ b/integration/snapshots/package-json-exports/index.debug.js @@ -1,6 +1,6 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import * as $4068f25b from "http://localhost:8080/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"; diff --git a/integration/snapshots/package-json-exports/index.hmr.debug.js b/integration/snapshots/package-json-exports/index.hmr.debug.js index 8c23e74fc..1310053b5 100644 --- a/integration/snapshots/package-json-exports/index.hmr.debug.js +++ b/integration/snapshots/package-json-exports/index.hmr.debug.js @@ -1,12 +1,15 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import * as $4068f25b from "http://localhost:8080/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"; @@ -17,7 +20,7 @@ import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modu var JSFileExtensionOnly = require($fce83cd7); Bun.activate(true); -var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports; +var hmr = new FastHMR(1953708113, "package-json-exports/index.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { async function test() { console.assert(InexactRoot.target === "browser"); diff --git a/integration/snapshots/package-json-exports/index.hmr.js b/integration/snapshots/package-json-exports/index.hmr.js index e70ea1868..70164e992 100644 --- a/integration/snapshots/package-json-exports/index.hmr.js +++ b/integration/snapshots/package-json-exports/index.hmr.js @@ -1,23 +1,26 @@ import { __require as require -} from "http://localhost:3000/bun:wrap"; -import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -import * as $4068f25b from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/index.js"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import * as $4068f25b from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js"; var InexactRoot = require($4068f25b); -import * as $d2a171d2 from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/dir/file.js"; +import * as $d2a171d2 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js"; var InexactFile = require($d2a171d2); -import * as $522c6d1f from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/foo.js"; +import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js"; var ExactFile = require($522c6d1f); -import * as $fce83cd7 from "http://localhost:3000/package-json-exports/node_modules/js-only-exports/browser/js-file.js"; +import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js"; var JSFileExtensionOnly = require($fce83cd7); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports; +var hmr = new FastHMR(1953708113, "package-json-exports/index.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { async function test() { console.assert(InexactRoot.target === "browser"); diff --git a/integration/snapshots/package-json-utf8.debug.js b/integration/snapshots/package-json-utf8.debug.js new file mode 100644 index 000000000..56110c9a3 --- /dev/null +++ b/integration/snapshots/package-json-utf8.debug.js @@ -0,0 +1,7 @@ +import pkg from "http://localhost:8080/utf8-package-json.json"; +export function test() { + console.assert(!!pkg.author); + + return testDone(import.meta.url); +} + diff --git a/integration/snapshots/package-json-utf8.hmr.debug.js b/integration/snapshots/package-json-utf8.hmr.debug.js new file mode 100644 index 000000000..170dbb734 --- /dev/null +++ b/integration/snapshots/package-json-utf8.hmr.debug.js @@ -0,0 +1,30 @@ +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import pkg from "http://localhost:8080/utf8-package-json.json"; +Bun.activate(true); + +var hmr = new FastHMR(4111115104, "package-json-utf8.js", FastRefresh), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(!!pkg.author); + 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/package-json-utf8.hmr.js b/integration/snapshots/package-json-utf8.hmr.js new file mode 100644 index 000000000..887c37a24 --- /dev/null +++ b/integration/snapshots/package-json-utf8.hmr.js @@ -0,0 +1,30 @@ +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +import pkg from "http://localhost:8080/utf8-package-json.json"; +Bun.activate(false); + +var hmr = new FastHMR(4111115104, "package-json-utf8.js", FastRefresh), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(!!pkg.author); + 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/package-json-utf8.js b/integration/snapshots/package-json-utf8.js new file mode 100644 index 000000000..56110c9a3 --- /dev/null +++ b/integration/snapshots/package-json-utf8.js @@ -0,0 +1,7 @@ +import pkg from "http://localhost:8080/utf8-package-json.json"; +export function test() { + console.assert(!!pkg.author); + + return testDone(import.meta.url); +} + diff --git a/integration/snapshots/react-context-value-func.debug.tsx b/integration/snapshots/react-context-value-func.debug.tsx index 6ce4b09db..1ddd49543 100644 --- a/integration/snapshots/react-context-value-func.debug.tsx +++ b/integration/snapshots/react-context-value-func.debug.tsx @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; diff --git a/integration/snapshots/react-context-value-func.hmr.debug.tsx b/integration/snapshots/react-context-value-func.hmr.debug.tsx index cfaca0723..770e0a388 100644 --- a/integration/snapshots/react-context-value-func.hmr.debug.tsx +++ b/integration/snapshots/react-context-value-func.hmr.debug.tsx @@ -1,11 +1,14 @@ import { -__HMRClient as Bun +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR } from "http://localhost:8080/bun:wrap"; import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); @@ -15,7 +18,7 @@ import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var { default: React} = require($bbcd215f); Bun.activate(true); -var hmr = new HMR(3514348331, "react-context-value-func.tsx"), exports = hmr.exports; +var hmr = new FastHMR(3514348331, "react-context-value-func.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const Context = React.createContext({}); const ContextProvider = ({ children }) => { diff --git a/integration/snapshots/react-context-value-func.hmr.tsx b/integration/snapshots/react-context-value-func.hmr.tsx index 42eee99fc..91c87a43b 100644 --- a/integration/snapshots/react-context-value-func.hmr.tsx +++ b/integration/snapshots/react-context-value-func.hmr.tsx @@ -1,21 +1,24 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var { default: React} = require($bbcd215f); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(3514348331, "react-context-value-func.tsx"), exports = hmr.exports; +var hmr = new FastHMR(3514348331, "react-context-value-func.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { const Context = React.createContext({}); const ContextProvider = ({ children }) => { diff --git a/integration/snapshots/spread_with_key.debug.tsx b/integration/snapshots/spread_with_key.debug.tsx index 25f380a8d..168a6e3ac 100644 --- a/integration/snapshots/spread_with_key.debug.tsx +++ b/integration/snapshots/spread_with_key.debug.tsx @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement; diff --git a/integration/snapshots/spread_with_key.hmr.debug.tsx b/integration/snapshots/spread_with_key.hmr.debug.tsx index 78754d7dd..f53c751e0 100644 --- a/integration/snapshots/spread_with_key.hmr.debug.tsx +++ b/integration/snapshots/spread_with_key.hmr.debug.tsx @@ -1,13 +1,17 @@ import { -__HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement; @@ -15,7 +19,7 @@ var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement; var { default: React} = require($bbcd215f); Bun.activate(true); -var hmr = new HMR(2717584935, "spread_with_key.tsx"), exports = hmr.exports; +var hmr = new FastHMR(2717584935, "spread_with_key.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { function SpreadWithTheKey({ className diff --git a/integration/snapshots/spread_with_key.hmr.tsx b/integration/snapshots/spread_with_key.hmr.tsx index 596ba8700..cd8fbd0e7 100644 --- a/integration/snapshots/spread_with_key.hmr.tsx +++ b/integration/snapshots/spread_with_key.hmr.tsx @@ -1,22 +1,25 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/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(true); +Bun.activate(false); -var hmr = new HMR(2717584935, "spread_with_key.tsx"), exports = hmr.exports; +var hmr = new FastHMR(2717584935, "spread_with_key.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { function SpreadWithTheKey({ className diff --git a/integration/snapshots/string-escapes.debug.js b/integration/snapshots/string-escapes.debug.js index 9feb91e50..a220eab93 100644 --- a/integration/snapshots/string-escapes.debug.js +++ b/integration/snapshots/string-escapes.debug.js @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; diff --git a/integration/snapshots/string-escapes.hmr.debug.js b/integration/snapshots/string-escapes.hmr.debug.js index 923c8b8b3..cb2a312ab 100644 --- a/integration/snapshots/string-escapes.hmr.debug.js +++ b/integration/snapshots/string-escapes.hmr.debug.js @@ -1,19 +1,23 @@ import { -__HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; Bun.activate(true); -var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; +var hmr = new FastHMR(2482749838, "string-escapes.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var tab = "\t"; var シ = "wow"; diff --git a/integration/snapshots/string-escapes.hmr.js b/integration/snapshots/string-escapes.hmr.js index 4c95ef6f3..1ad77ecc2 100644 --- a/integration/snapshots/string-escapes.hmr.js +++ b/integration/snapshots/string-escapes.hmr.js @@ -1,20 +1,23 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var JSXClassic = require($bbcd215f); var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment; -Bun.activate(true); -var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; +Bun.activate(false); +var hmr = new FastHMR(2482749838, "string-escapes.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var tab = "\t"; var シ = "wow"; diff --git a/integration/snapshots/styledcomponents-output.debug.js b/integration/snapshots/styledcomponents-output.debug.js index 7dcaa3d08..0df85b5c0 100644 --- a/integration/snapshots/styledcomponents-output.debug.js +++ b/integration/snapshots/styledcomponents-output.debug.js @@ -1,7 +1,8 @@ import { __require as require -} from "http://localhost:8080/bun:runtime"; -import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; +var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js"; diff --git a/integration/snapshots/styledcomponents-output.hmr.debug.js b/integration/snapshots/styledcomponents-output.hmr.debug.js index 2c93c0c08..62fe9e4e4 100644 --- a/integration/snapshots/styledcomponents-output.hmr.debug.js +++ b/integration/snapshots/styledcomponents-output.hmr.debug.js @@ -1,11 +1,14 @@ import { -__HMRClient as Bun +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; import { __require as require } from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR } from "http://localhost:8080/bun:wrap"; import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); @@ -19,7 +22,7 @@ import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.j var { default: ReactDOM} = require($5b3cea55); Bun.activate(true); -var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.exports; +var hmr = new FastHMR(1290604342, "styledcomponents-output.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const ErrorScreenRoot = styled.div` font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial, diff --git a/integration/snapshots/styledcomponents-output.hmr.js b/integration/snapshots/styledcomponents-output.hmr.js index 8967d17e5..d69f59986 100644 --- a/integration/snapshots/styledcomponents-output.hmr.js +++ b/integration/snapshots/styledcomponents-output.hmr.js @@ -1,25 +1,28 @@ import { -__HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; import { __require as require -} from "http://localhost:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; +import { +__HMRClient as Bun +} from "http://localhost:8080/bun:wrap"; import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js"; +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js"; var JSX = require($2f488e5b); var jsx = require(JSX).jsxDEV; -import * as $d4051a2e from "http://localhost:3000/node_modules/styled-components/dist/styled-components.browser.esm.js"; +import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js"; var { default: styled} = require($d4051a2e); -import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; var { default: React} = require($bbcd215f); -import * as $5b3cea55 from "http://localhost:3000/node_modules/react-dom/index.js"; +import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js"; var { default: ReactDOM} = require($5b3cea55); -Bun.activate(true); +Bun.activate(false); -var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.exports; +var hmr = new FastHMR(1290604342, "styledcomponents-output.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const ErrorScreenRoot = styled.div` font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial, diff --git a/integration/snapshots/template-literal.hmr.debug.js b/integration/snapshots/template-literal.hmr.debug.js index b3397e7a5..5d65d4968 100644 --- a/integration/snapshots/template-literal.hmr.debug.js +++ b/integration/snapshots/template-literal.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(2201713056, "template-literal.js"), exports = hmr.exports; +var hmr = new FastHMR(2201713056, "template-literal.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const css = (templ) => templ.toString(); const fooNoBracesUTF8 = css` diff --git a/integration/snapshots/template-literal.hmr.js b/integration/snapshots/template-literal.hmr.js index e464c4ee0..8f647061a 100644 --- a/integration/snapshots/template-literal.hmr.js +++ b/integration/snapshots/template-literal.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(2201713056, "template-literal.js"), exports = hmr.exports; +var hmr = new FastHMR(2201713056, "template-literal.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { const css = (templ) => templ.toString(); const fooNoBracesUTF8 = css` diff --git a/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js b/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js index 1b2c6fbf2..0444bf771 100644 --- a/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js +++ b/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js @@ -1,9 +1,9 @@ import { __HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); var hmr = new HMR(421762902, "ts-fallback-rewrite-works.ts"), exports = hmr.exports; diff --git a/integration/snapshots/ts-fallback-rewrite-works.hmr.js b/integration/snapshots/ts-fallback-rewrite-works.hmr.js index d4156081f..4f19ee3c6 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:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); 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.debug.js b/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js index b9155a35f..900175b44 100644 --- a/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js +++ b/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(2117426367, "tsx-fallback-rewrite-works.tsx"), exports = hmr.exports; +var hmr = new FastHMR(2117426367, "tsx-fallback-rewrite-works.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { return testDone(import.meta.url); diff --git a/integration/snapshots/tsx-fallback-rewrite-works.hmr.js b/integration/snapshots/tsx-fallback-rewrite-works.hmr.js index 5d5212e12..1828fa831 100644 --- a/integration/snapshots/tsx-fallback-rewrite-works.hmr.js +++ b/integration/snapshots/tsx-fallback-rewrite-works.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(2117426367, "tsx-fallback-rewrite-works.tsx"), exports = hmr.exports; +var hmr = new FastHMR(2117426367, "tsx-fallback-rewrite-works.tsx", FastRefresh), exports = hmr.exports; (hmr._load = function() { function test() { return testDone(import.meta.url); diff --git a/integration/snapshots/type-only-imports.hmr.debug.ts b/integration/snapshots/type-only-imports.hmr.debug.ts index c6ddfa45f..cd3461e7a 100644 --- a/integration/snapshots/type-only-imports.hmr.debug.ts +++ b/integration/snapshots/type-only-imports.hmr.debug.ts @@ -1,9 +1,9 @@ import { __HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); var hmr = new HMR(650094581, "type-only-imports.ts"), exports = hmr.exports; diff --git a/integration/snapshots/type-only-imports.hmr.ts b/integration/snapshots/type-only-imports.hmr.ts index 384dffc50..b58f0cb4a 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:3000/bun:wrap"; +} from "http://localhost:8080/bun:wrap"; import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); var hmr = new HMR(650094581, "type-only-imports.ts"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/unicode-identifiers.hmr.debug.js b/integration/snapshots/unicode-identifiers.hmr.debug.js index 81017ff5c..f03b022a3 100644 --- a/integration/snapshots/unicode-identifiers.hmr.debug.js +++ b/integration/snapshots/unicode-identifiers.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:8080/bun:runtime"; -import { __HMRClient as Bun -} from "http://localhost:8080/bun:runtime"; +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(1398361736, "unicode-identifiers.js"), exports = hmr.exports; +var hmr = new FastHMR(1398361736, "unicode-identifiers.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var ε = 0.000001, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π; function test() { diff --git a/integration/snapshots/unicode-identifiers.hmr.js b/integration/snapshots/unicode-identifiers.hmr.js index 40b339582..a52106ea3 100644 --- a/integration/snapshots/unicode-identifiers.hmr.js +++ b/integration/snapshots/unicode-identifiers.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(1398361736, "unicode-identifiers.js"), exports = hmr.exports; +var hmr = new FastHMR(1398361736, "unicode-identifiers.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var ε = 0.000001, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π; function test() { diff --git a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.debug.js b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.debug.js index cef7a9290..1d259292e 100644 --- a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.debug.js +++ b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.debug.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR +__HMRClient as Bun } from "http://localhost:8080/bun:wrap"; import { -__HMRClient as Bun +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh } from "http://localhost:8080/bun:wrap"; Bun.activate(true); -var hmr = new HMR(635901064, "void-shouldnt-delete-call-expressions.js"), exports = hmr.exports; +var hmr = new FastHMR(635901064, "void-shouldnt-delete-call-expressions.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var was_called = false; function thisShouldBeCalled() { diff --git a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js index fc53d5258..cbeba78f2 100644 --- a/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js +++ b/integration/snapshots/void-shouldnt-delete-call-expressions.hmr.js @@ -1,12 +1,15 @@ import { -__HMRModule as HMR -} from "http://localhost:3000/bun:wrap"; -import { __HMRClient as Bun -} from "http://localhost:3000/bun:wrap"; -Bun.activate(true); +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshModule as FastHMR +} from "http://localhost:8080/bun:wrap"; +import { +__FastRefreshRuntime as FastRefresh +} from "http://localhost:8080/bun:wrap"; +Bun.activate(false); -var hmr = new HMR(635901064, "void-shouldnt-delete-call-expressions.js"), exports = hmr.exports; +var hmr = new FastHMR(635901064, "void-shouldnt-delete-call-expressions.js", FastRefresh), exports = hmr.exports; (hmr._load = function() { var was_called = false; function thisShouldBeCalled() { |