diff options
author | 2021-09-22 01:02:32 -0700 | |
---|---|---|
committer | 2021-09-22 01:02:32 -0700 | |
commit | a48a02bade5079ab7c5ddd293ba8dc3b2f87ed26 (patch) | |
tree | 152843c5cac9910fe8e21610053a1a694325a553 /integration/snapshots | |
parent | 2326a1e1050d19a9b958893f07414f89e42dc82c (diff) | |
download | bun-a48a02bade5079ab7c5ddd293ba8dc3b2f87ed26.tar.gz bun-a48a02bade5079ab7c5ddd293ba8dc3b2f87ed26.tar.zst bun-a48a02bade5079ab7c5ddd293ba8dc3b2f87ed26.zip |
Switch to a single directory for storing snapshots and explicitly note whats a debug snapshot and a non-debug snapshot
Diffstat (limited to 'integration/snapshots')
35 files changed, 708 insertions, 10 deletions
diff --git a/integration/snapshots/bundled-entry-point.debug.js b/integration/snapshots/bundled-entry-point.debug.js new file mode 100644 index 000000000..04f92d63a --- /dev/null +++ b/integration/snapshots/bundled-entry-point.debug.js @@ -0,0 +1,9 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js"; +var hello = null ?? "world"; + +export function test() { + return testDone(import.meta.url); +} diff --git a/integration/snapshots/bundled-entry-point.hmr.debug.js b/integration/snapshots/bundled-entry-point.hmr.debug.js new file mode 100644 index 000000000..fd211daa2 --- /dev/null +++ b/integration/snapshots/bundled-entry-point.hmr.debug.js @@ -0,0 +1,30 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__HMRModule as HMR +} from "http://localhost:8080/__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(true); + +var hmr = new HMR(3012834585, "bundled-entry-point.js"), exports = hmr.exports; +(hmr._load = function() { + var hello = null ?? "world"; + function test() { + 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/bundled-entry-point.js b/integration/snapshots/bundled-entry-point.js index f3008327a..fd211daa2 100644 --- a/integration/snapshots/bundled-entry-point.js +++ b/integration/snapshots/bundled-entry-point.js @@ -8,7 +8,7 @@ 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); +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.debug.js b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js new file mode 100644 index 000000000..d9f64c5b9 --- /dev/null +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.debug.js @@ -0,0 +1,37 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__cJS2eSM +} from "http://localhost:8080/__runtime.js"; +import * as _login_b977_0 from "http://localhost:8080/_login.js"; +import * as _login_b977_1 from "http://localhost:8080/_login.js"; +import _login from "http://localhost:8080/_login.js"; +import _auth from "http://localhost:8080/_auth.js"; +import * as _loginReally from "http://localhost:8080/_login.js"; +import * as _loginReally2 from "http://localhost:8080/_login.js"; +import * as _authReally from "http://localhost:8080/_auth.js"; + +export default __cJS2eSM(function(module, exports) { + ; + + ; + ; + ; + ; + module.exports.iAmCommonJs = true; + exports.YouAreCommonJS = true; + require(_login_b977_0); + require(_login_b977_1); + Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); + var test = function test() { + return testDone(import.meta.url); + }; + Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); + let foo, bar; + Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, +'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); +}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); + + + 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 new file mode 100644 index 000000000..d8e3ccdd1 --- /dev/null +++ b/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js @@ -0,0 +1,37 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__cJS2eSM +} from "http://localhost:8080/__runtime.js"; +import * as _login_b977_0 from "http://localhost:8080/_login.js"; +import * as _login_b977_1 from "http://localhost:8080/_login.js"; +import _login from "http://localhost:8080/_login.js"; +import _auth from "http://localhost:8080/_auth.js"; +import * as _loginReally from "http://localhost:8080/_login.js"; +import * as _loginReally2 from "http://localhost:8080/_login.js"; +import * as _authReally from "http://localhost:8080/_auth.js"; + +export default __cJS2eSM(function(module, exports) { + ; + + ; + ; + ; + ; + module.exports.iAmCommonJs = true; + exports.YouAreCommonJS = true; + require(_login_b977_0); + require(_login_b977_1); + Object.defineProperty(module.exports,"login",{get: () => _login, enumerable: true, configurable: true}); + var test = function test() { + return testDone(import.meta.url); + }; + Object.defineProperty(module.exports,"test",{get: () => test, enumerable: true, configurable: true}); + var foo, bar; + Object.defineProperties(module.exports,{'foo': {get: () => foo, set: ($_newValue) => {foo = $_newValue;}, enumerable: true, configurable: true}, +'bar': {get: () => bar, set: ($_newValue) => {bar = $_newValue;}, enumerable: true, configurable: true}}); +}, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js"); + + + diff --git a/integration/snapshots/export.debug.js b/integration/snapshots/export.debug.js new file mode 100644 index 000000000..534cb2a0c --- /dev/null +++ b/integration/snapshots/export.debug.js @@ -0,0 +1,31 @@ +import what from "http://localhost:8080/_auth.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 let yoyoyo = "yoyoyo"; + +export default function hey() { + return true; +} +export const foo = () => { +}; +export var bar = 100; +export let powerLevel = Symbol("9001"); + +export {what}; +export {what as when, what as whence}; +export {} from "http://localhost:8080/_bacon.js"; +import * as where from "http://localhost:8080/_auth.js"; + +export {where}; + +export {bar as booop}; +export function test() { + hey(); + foo(); + if (where.default !== "hi") + throw new Error(`_auth import is incorrect.`); + console.assert(powerLevel.description === "9001", "Symbol is not exported correctly"); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/export.hmr.debug.js b/integration/snapshots/export.hmr.debug.js new file mode 100644 index 000000000..b5d3e0ad1 --- /dev/null +++ b/integration/snapshots/export.hmr.debug.js @@ -0,0 +1,74 @@ +import { +__HMRModule as HMR +} from "http://localhost:8080/__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(true); + +var hmr = new HMR(1879780259, "export.js"), exports = hmr.exports; +(hmr._load = function() { + var yoyoyo = "yoyoyo"; + function hey() { + return true; + } + var foo = () => { + }; + var bar = 100; + var powerLevel = Symbol("9001"); + function test() { + hey(); + foo(); + if (where.default !== "hi") + throw new Error(`_auth import is incorrect.`); + console.assert(powerLevel.description === "9001", "Symbol is not exported correctly"); + return testDone(import.meta.url); + } + hmr.exportAll({ + yoyoyo: () => yoyoyo, + default: () => hey, + foo: () => foo, + bar: () => bar, + powerLevel: () => powerLevel, + what: () => what, + when: () => what, + whence: () => what, + where: () => where, + booop: () => bar, + test: () => test + }); +})(); +var $$hmr_yoyoyo = hmr.exports.yoyoyo, $$hmr_default = hmr.exports.default, $$hmr_foo = hmr.exports.foo, $$hmr_bar = hmr.exports.bar, $$hmr_powerLevel = hmr.exports.powerLevel, $$hmr_what = hmr.exports.what, $$hmr_when = hmr.exports.when, $$hmr_whence = hmr.exports.whence, $$hmr_where = hmr.exports.where, $$hmr_booop = hmr.exports.booop, $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_yoyoyo = exports.yoyoyo; + $$hmr_default = exports.default; + $$hmr_foo = exports.foo; + $$hmr_bar = exports.bar; + $$hmr_powerLevel = exports.powerLevel; + $$hmr_what = exports.what; + $$hmr_when = exports.when; + $$hmr_whence = exports.whence; + $$hmr_where = exports.where; + $$hmr_booop = exports.booop; + $$hmr_test = exports.test; +}; + +export { + $$hmr_yoyoyo as yoyoyo, + $$hmr_default as default, + $$hmr_foo as foo, + $$hmr_bar as bar, + $$hmr_powerLevel as powerLevel, + $$hmr_what as what, + $$hmr_when as when, + $$hmr_whence as whence, + $$hmr_where as where, + $$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"; diff --git a/integration/snapshots/export.js b/integration/snapshots/export.js index 6088ffd77..b5d3e0ad1 100644 --- a/integration/snapshots/export.js +++ b/integration/snapshots/export.js @@ -6,7 +6,7 @@ __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); +Bun.activate(true); var hmr = new HMR(1879780259, "export.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/global-is-remapped-to-globalThis.debug.js b/integration/snapshots/global-is-remapped-to-globalThis.debug.js new file mode 100644 index 000000000..9000d14b0 --- /dev/null +++ b/integration/snapshots/global-is-remapped-to-globalThis.debug.js @@ -0,0 +1,4 @@ +export function test() { + console.assert(globalThis === globalThis); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js b/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js new file mode 100644 index 000000000..dace8fa7a --- /dev/null +++ b/integration/snapshots/global-is-remapped-to-globalThis.hmr.debug.js @@ -0,0 +1,26 @@ +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(713665787, "global-is-remapped-to-globalThis.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(globalThis === globalThis); + 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/global-is-remapped-to-globalThis.js b/integration/snapshots/global-is-remapped-to-globalThis.js index a5a3723a6..dace8fa7a 100644 --- a/integration/snapshots/global-is-remapped-to-globalThis.js +++ b/integration/snapshots/global-is-remapped-to-globalThis.js @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +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/lodash-regexp.debug.js b/integration/snapshots/lodash-regexp.debug.js new file mode 100644 index 000000000..6e0e6190a --- /dev/null +++ b/integration/snapshots/lodash-regexp.debug.js @@ -0,0 +1,21 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; +var { shuffle} = require($60f52dc2); +export function test() { + const foo = [1, 2, 3, 4, 6]; + + const bar = shuffle(foo); + console.assert(bar !== foo); + console.assert(bar.length === foo.length); + bar.sort(); + foo.sort(); + for (let i = 0;i < bar.length; i++) { + console.assert(bar[i] === foo[i], "expected " + i + " to be " + foo[i]); + console.assert(typeof bar[i] === "number"); + console.assert(typeof foo[i] === "number"); + } + return testDone(import.meta.url); +} + diff --git a/integration/snapshots/lodash-regexp.hmr.debug.js b/integration/snapshots/lodash-regexp.hmr.debug.js new file mode 100644 index 000000000..3030e47c6 --- /dev/null +++ b/integration/snapshots/lodash-regexp.hmr.debug.js @@ -0,0 +1,41 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__HMRModule as HMR +} from "http://localhost:8080/__runtime.js"; +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +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; +(hmr._load = function() { + function test() { + const foo = [1, 2, 3, 4, 6]; + const bar = shuffle(foo); + console.assert(bar !== foo); + console.assert(bar.length === foo.length); + bar.sort(); + foo.sort(); + for (let i = 0;i < bar.length; i++) { + console.assert(bar[i] === foo[i], "expected " + i + " to be " + foo[i]); + console.assert(typeof bar[i] === "number"); + console.assert(typeof foo[i] === "number"); + } + 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/lodash-regexp.js b/integration/snapshots/lodash-regexp.js index cd9ca40f7..3030e47c6 100644 --- a/integration/snapshots/lodash-regexp.js +++ b/integration/snapshots/lodash-regexp.js @@ -9,7 +9,7 @@ __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; import * as $60f52dc2 from "http://localhost:8080/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.debug.js b/integration/snapshots/multiple-imports.debug.js new file mode 100644 index 000000000..7826c8765 --- /dev/null +++ b/integration/snapshots/multiple-imports.debug.js @@ -0,0 +1,25 @@ +import { +__require as require +} 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"; +var JSXClassic = require($bbcd215f); +var jsx = require(JSX).jsxDEV, fileName = "multiple-imports.js", JSXFrag = require(JSX, JSXClassic).Fragment; + +var { default: React} = require($bbcd215f); +var { default: React2} = require($bbcd215f); +const bacon = React; + +const bacon2 = jsx(JSXFrag, { + children: ["hello"] +}, undefined, true, { + fileName, + lineNumber: 92 +}, this); +export function test() { + console.assert(bacon === React); + console.assert(bacon === React2); + console.assert(typeof bacon2 !== "undefined"); + console.assert(React.isValidElement(bacon2)); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/multiple-imports.hmr.debug.js b/integration/snapshots/multiple-imports.hmr.debug.js new file mode 100644 index 000000000..048988d09 --- /dev/null +++ b/integration/snapshots/multiple-imports.hmr.debug.js @@ -0,0 +1,46 @@ +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +import { +__require as require +} from "http://localhost:8080/__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"; +var JSXClassic = require($bbcd215f); +var jsx = require(JSX).jsxDEV, fileName = "multiple-imports.js", JSXFrag = require(JSX, JSXClassic).Fragment; + +var { default: React} = require($bbcd215f); +var { default: React2} = require($bbcd215f); +Bun.activate(true); + +var hmr = new HMR(2165509932, "multiple-imports.js"), exports = hmr.exports; +(hmr._load = function() { + const bacon = React; + const bacon2 = jsx(JSXFrag, { + children: ["hello"] + }, undefined, true, { + fileName, + lineNumber: 92 + }, this); + function test() { + console.assert(bacon === React); + console.assert(bacon === React2); + console.assert(typeof bacon2 !== "undefined"); + console.assert(React.isValidElement(bacon2)); + 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/multiple-imports.js b/integration/snapshots/multiple-imports.js index 727907e62..048988d09 100644 --- a/integration/snapshots/multiple-imports.js +++ b/integration/snapshots/multiple-imports.js @@ -14,7 +14,7 @@ var jsx = require(JSX).jsxDEV, fileName = "multiple-imports.js", JSXFrag = requi 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/package-json-exports/index.debug.js b/integration/snapshots/package-json-exports/index.debug.js new file mode 100644 index 000000000..0fdd7e692 --- /dev/null +++ b/integration/snapshots/package-json-exports/index.debug.js @@ -0,0 +1,17 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +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"; +var InexactFile = require($d2a171d2); +import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js"; +var ExactFile = require($522c6d1f); +export function test() { + console.assert(InexactRoot.target === "browser"); + + console.assert(InexactFile.target === "browser"); + console.assert(ExactFile.target === "browser"); + return testDone(import.meta.url); +} + diff --git a/integration/snapshots/package-json-exports/index.hmr.debug.js b/integration/snapshots/package-json-exports/index.hmr.debug.js new file mode 100644 index 000000000..6d00451f2 --- /dev/null +++ b/integration/snapshots/package-json-exports/index.hmr.debug.js @@ -0,0 +1,37 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__HMRModule as HMR +} from "http://localhost:8080/__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"; +var InexactRoot = require($4068f25b); +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:8080/package-json-exports/node_modules/inexact/browser/foo.js"; +var ExactFile = require($522c6d1f); +Bun.activate(true); + +var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(InexactRoot.target === "browser"); + console.assert(InexactFile.target === "browser"); + console.assert(ExactFile.target === "browser"); + 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-exports/index.js b/integration/snapshots/package-json-exports/index.js new file mode 100644 index 000000000..6d00451f2 --- /dev/null +++ b/integration/snapshots/package-json-exports/index.js @@ -0,0 +1,37 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__HMRModule as HMR +} from "http://localhost:8080/__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"; +var InexactRoot = require($4068f25b); +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:8080/package-json-exports/node_modules/inexact/browser/foo.js"; +var ExactFile = require($522c6d1f); +Bun.activate(true); + +var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(InexactRoot.target === "browser"); + console.assert(InexactFile.target === "browser"); + console.assert(ExactFile.target === "browser"); + 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/string-escapes.debug.js b/integration/snapshots/string-escapes.debug.js new file mode 100644 index 000000000..05d9c4ce2 --- /dev/null +++ b/integration/snapshots/string-escapes.debug.js @@ -0,0 +1,34 @@ +var tab = "\t"; +var シ = "wow"; +var f = ""; +var obj = { + "\r\n": "\r\n", + "\n": "\n", + "\t": "\t", + "\u2028": "\u2028", + "\u2029": "\u2029", + "😊": "😊", + "😃": "😃", + "㋡": "㋡", + "☺": "☺", + シ: "シ", + f, + "☹": "☹", + "☻": "☻", + children: 123 +}; +const foo = () => { +}; +const Bar = foo("a", { + children: 123 +}); +const carriage = obj["\r\n"]; +const newline = obj["\n"]; + +export {obj}; +export function test() { + console.assert(carriage === "\r\n"); + console.assert(newline === "\n"); + console.assert(tab === "\t"); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/string-escapes.hmr.debug.js b/integration/snapshots/string-escapes.hmr.debug.js new file mode 100644 index 000000000..bc866d834 --- /dev/null +++ b/integration/snapshots/string-escapes.hmr.debug.js @@ -0,0 +1,57 @@ +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(2482749838, "string-escapes.js"), exports = hmr.exports; +(hmr._load = function() { + var tab = "\t"; + var シ = "wow"; + var f = ""; + var obj = { + "\r\n": "\r\n", + "\n": "\n", + "\t": "\t", + "\u2028": "\u2028", + "\u2029": "\u2029", + "😊": "😊", + "😃": "😃", + "㋡": "㋡", + "☺": "☺", + シ: "シ", + f, + "☹": "☹", + "☻": "☻", + children: 123 + }; + const foo = () => { + }; + const Bar = foo("a", { + children: 123 + }); + const carriage = obj["\r\n"]; + const newline = obj["\n"]; + function test() { + console.assert(carriage === "\r\n"); + console.assert(newline === "\n"); + console.assert(tab === "\t"); + return testDone(import.meta.url); + } + hmr.exportAll({ + obj: () => obj, + test: () => test + }); +})(); +var $$hmr_obj = hmr.exports.obj, $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_obj = exports.obj; + $$hmr_test = exports.test; +}; + +export { + $$hmr_obj as obj, + $$hmr_test as test +}; diff --git a/integration/snapshots/string-escapes.js b/integration/snapshots/string-escapes.js index 9231cb6cf..bc866d834 100644 --- a/integration/snapshots/string-escapes.js +++ b/integration/snapshots/string-escapes.js @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(2482749838, "string-escapes.js"), exports = hmr.exports; (hmr._load = function() { diff --git a/integration/snapshots/ts-fallback-rewrite-works.debug.js b/integration/snapshots/ts-fallback-rewrite-works.debug.js new file mode 100644 index 000000000..a4e489f28 --- /dev/null +++ b/integration/snapshots/ts-fallback-rewrite-works.debug.js @@ -0,0 +1,3 @@ +export function test() { + return testDone(import.meta.url); +} diff --git a/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js b/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js new file mode 100644 index 000000000..c90ac6d25 --- /dev/null +++ b/integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js @@ -0,0 +1,25 @@ +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(421762902, "ts-fallback-rewrite-works.ts"), exports = hmr.exports; +(hmr._load = function() { + function test() { + 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/ts-fallback-rewrite-works.js b/integration/snapshots/ts-fallback-rewrite-works.js index e728c5f14..c90ac6d25 100644 --- a/integration/snapshots/ts-fallback-rewrite-works.js +++ b/integration/snapshots/ts-fallback-rewrite-works.js @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +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.debug.js b/integration/snapshots/tsx-fallback-rewrite-works.debug.js new file mode 100644 index 000000000..a4e489f28 --- /dev/null +++ b/integration/snapshots/tsx-fallback-rewrite-works.debug.js @@ -0,0 +1,3 @@ +export function test() { + return testDone(import.meta.url); +} diff --git a/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js b/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js new file mode 100644 index 000000000..d3aa0919a --- /dev/null +++ b/integration/snapshots/tsx-fallback-rewrite-works.hmr.debug.js @@ -0,0 +1,25 @@ +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(2117426367, "tsx-fallback-rewrite-works.tsx"), exports = hmr.exports; +(hmr._load = function() { + function test() { + 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/tsx-fallback-rewrite-works.js b/integration/snapshots/tsx-fallback-rewrite-works.js index 3f2f754e2..d3aa0919a 100644 --- a/integration/snapshots/tsx-fallback-rewrite-works.js +++ b/integration/snapshots/tsx-fallback-rewrite-works.js @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +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.debug.ts b/integration/snapshots/type-only-imports.debug.ts new file mode 100644 index 000000000..b4503474d --- /dev/null +++ b/integration/snapshots/type-only-imports.debug.ts @@ -0,0 +1,7 @@ +export const baconator = true; +export const SilentSymbolCollisionsAreOkayInTypeScript = true; +export function test() { + console.assert(SilentSymbolCollisionsAreOkayInTypeScript); + console.assert(baconator); + 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 new file mode 100644 index 000000000..c647843ea --- /dev/null +++ b/integration/snapshots/type-only-imports.hmr.debug.ts @@ -0,0 +1,35 @@ +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(650094581, "type-only-imports.ts"), exports = hmr.exports; +(hmr._load = function() { + var baconator = true; + var SilentSymbolCollisionsAreOkayInTypeScript = true; + function test() { + console.assert(SilentSymbolCollisionsAreOkayInTypeScript); + console.assert(baconator); + return testDone(import.meta.url); + } + hmr.exportAll({ + baconator: () => baconator, + SilentSymbolCollisionsAreOkayInTypeScript: () => SilentSymbolCollisionsAreOkayInTypeScript, + test: () => test + }); +})(); +var $$hmr_baconator = hmr.exports.baconator, $$hmr_SilentSymbolCollisionsAreOkayInTypeScript = hmr.exports.SilentSymbolCollisionsAreOkayInTypeScript, $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_baconator = exports.baconator; + $$hmr_SilentSymbolCollisionsAreOkayInTypeScript = exports.SilentSymbolCollisionsAreOkayInTypeScript; + $$hmr_test = exports.test; +}; + +export { + $$hmr_baconator as baconator, + $$hmr_SilentSymbolCollisionsAreOkayInTypeScript as SilentSymbolCollisionsAreOkayInTypeScript, + $$hmr_test as test +}; diff --git a/integration/snapshots/type-only-imports.ts b/integration/snapshots/type-only-imports.ts index 84740d0d9..c647843ea 100644 --- a/integration/snapshots/type-only-imports.ts +++ b/integration/snapshots/type-only-imports.ts @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +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.debug.js b/integration/snapshots/unicode-identifiers.debug.js new file mode 100644 index 000000000..c495d69f6 --- /dev/null +++ b/integration/snapshots/unicode-identifiers.debug.js @@ -0,0 +1,7 @@ +var ε = 1.0e-06, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π; + +export {d3_radians}; +export function test() { + console.assert(ε === 1.0e-06); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/unicode-identifiers.hmr.debug.js b/integration/snapshots/unicode-identifiers.hmr.debug.js new file mode 100644 index 000000000..729365d1d --- /dev/null +++ b/integration/snapshots/unicode-identifiers.hmr.debug.js @@ -0,0 +1,30 @@ +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(1398361736, "unicode-identifiers.js"), exports = hmr.exports; +(hmr._load = function() { + var ε = 1.0e-06, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π; + function test() { + console.assert(ε === 1.0e-06); + return testDone(import.meta.url); + } + hmr.exportAll({ + d3_radians: () => d3_radians, + test: () => test + }); +})(); +var $$hmr_d3_radians = hmr.exports.d3_radians, $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_d3_radians = exports.d3_radians; + $$hmr_test = exports.test; +}; + +export { + $$hmr_d3_radians as d3_radians, + $$hmr_test as test +}; diff --git a/integration/snapshots/unicode-identifiers.js b/integration/snapshots/unicode-identifiers.js index 5d465d559..729365d1d 100644 --- a/integration/snapshots/unicode-identifiers.js +++ b/integration/snapshots/unicode-identifiers.js @@ -4,7 +4,7 @@ __HMRModule as HMR import { __HMRClient as Bun } from "http://localhost:8080/__runtime.js"; -Bun.activate(false); +Bun.activate(true); var hmr = new HMR(1398361736, "unicode-identifiers.js"), exports = hmr.exports; (hmr._load = function() { |