mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
Compare commits
159 Commits
bun-v0.0.1
...
bun-v0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ac4abf8a0 | ||
|
|
139622e0b8 | ||
|
|
aaa4aaf53f | ||
|
|
73c27a9a25 | ||
|
|
82bf89a946 | ||
|
|
f4a4e793aa | ||
|
|
cdabcfd9d0 | ||
|
|
ac7a96b088 | ||
|
|
6932f3d543 | ||
|
|
222027991f | ||
|
|
5bb5091fe0 | ||
|
|
c8127d0ae6 | ||
|
|
8764fa6d4e | ||
|
|
86b7b5b8d8 | ||
|
|
127426f506 | ||
|
|
09cc970b9e | ||
|
|
03f7c5be1f | ||
|
|
4ecf513662 | ||
|
|
76b450386f | ||
|
|
38a54898a3 | ||
|
|
147d1f3951 | ||
|
|
d47419f471 | ||
|
|
367f9c9674 | ||
|
|
f9a906873e | ||
|
|
4be8aaeab8 | ||
|
|
5fdaad9a2f | ||
|
|
5855fb7cc6 | ||
|
|
f226f52200 | ||
|
|
db24a27e61 | ||
|
|
f8297aee4d | ||
|
|
b267aace71 | ||
|
|
b4bd8e4169 | ||
|
|
fdda1078f8 | ||
|
|
88e7e12a50 | ||
|
|
4cdc8939ab | ||
|
|
ec256209a8 | ||
|
|
74db7809eb | ||
|
|
5dac4e6108 | ||
|
|
e51155d8e6 | ||
|
|
2bb7f71b9c | ||
|
|
2f8be4f13f | ||
|
|
8e9d85f10f | ||
|
|
70bae801dc | ||
|
|
37ffe4501c | ||
|
|
13f6297312 | ||
|
|
f9dfa226a5 | ||
|
|
0da19a25cf | ||
|
|
3b92a867e2 | ||
|
|
1ada4a2c67 | ||
|
|
97ad21dc68 | ||
|
|
54dc9cfc8b | ||
|
|
1ed51e8866 | ||
|
|
9e0511995a | ||
|
|
62d51f7d2e | ||
|
|
4f9558dd71 | ||
|
|
86109dcfd0 | ||
|
|
adf22db8b6 | ||
|
|
eb3473125c | ||
|
|
b3894994c0 | ||
|
|
e1306be4be | ||
|
|
002d46d0c4 | ||
|
|
018ba2c83b | ||
|
|
66ed7c1f30 | ||
|
|
a113603f10 | ||
|
|
6f6d62d915 | ||
|
|
ff8393ce32 | ||
|
|
8b209aecf9 | ||
|
|
a515a2d039 | ||
|
|
d0fec462c9 | ||
|
|
20e2040e7e | ||
|
|
538f73b2fa | ||
|
|
a0fb04d6e5 | ||
|
|
44497ef384 | ||
|
|
5fb38b92d9 | ||
|
|
4737588aac | ||
|
|
a5d3ce4e96 | ||
|
|
66b29654c0 | ||
|
|
940570af59 | ||
|
|
bdfb5a91b1 | ||
|
|
29b986684d | ||
|
|
e48a0877ef | ||
|
|
22837d69b7 | ||
|
|
af306b523b | ||
|
|
ba20fd7566 | ||
|
|
6d1330d601 | ||
|
|
f3be0c79c2 | ||
|
|
10c01af692 | ||
|
|
a68a1983cf | ||
|
|
90a647fb72 | ||
|
|
3cbf209d5b | ||
|
|
bee45c4fdc | ||
|
|
61202cb464 | ||
|
|
0091944161 | ||
|
|
78cd857bf6 | ||
|
|
4fe1b4df1c | ||
|
|
2a1235c9db | ||
|
|
4bb41b95a8 | ||
|
|
f78f4854a4 | ||
|
|
ff01dfa03d | ||
|
|
638b204d1e | ||
|
|
58e88c4aed | ||
|
|
8433919342 | ||
|
|
8150b9aeba | ||
|
|
01601fc8a7 | ||
|
|
7b24042d5f | ||
|
|
2177dda242 | ||
|
|
0585c86390 | ||
|
|
528caab47c | ||
|
|
b150df34e0 | ||
|
|
da80c3b309 | ||
|
|
e8804bd80f | ||
|
|
2300886008 | ||
|
|
57ed3c89a2 | ||
|
|
1a284a1c94 | ||
|
|
f12dd51c00 | ||
|
|
e00c1e99d6 | ||
|
|
39323b46ba | ||
|
|
9dff80aeee | ||
|
|
9f7d05bab4 | ||
|
|
53c0a4b568 | ||
|
|
8f460a9be3 | ||
|
|
204b07f46b | ||
|
|
a48a02bade | ||
|
|
2326a1e105 | ||
|
|
c4dc6d9bff | ||
|
|
6213a73e6f | ||
|
|
9c109b744f | ||
|
|
42c1d54b3f | ||
|
|
5e634cd612 | ||
|
|
79c7fe0f7a | ||
|
|
8e86d2cf1d | ||
|
|
4e12a4c013 | ||
|
|
e869cdca9f | ||
|
|
ab565f1a3c | ||
|
|
90cd3bf4cb | ||
|
|
9752ee8819 | ||
|
|
9f1e0660dd | ||
|
|
7c05bb7d1d | ||
|
|
bb0faacf06 | ||
|
|
9ae35ec581 | ||
|
|
b1ca1eb228 | ||
|
|
832502555c | ||
|
|
1176a07c93 | ||
|
|
3770102843 | ||
|
|
cf7c80d42d | ||
|
|
84632571c7 | ||
|
|
af1061e47a | ||
|
|
e1ce0e8467 | ||
|
|
468c475359 | ||
|
|
8902a19bb4 | ||
|
|
f4e72be58f | ||
|
|
c20b5414c4 | ||
|
|
1a0438b3b1 | ||
|
|
da2f85ba4b | ||
|
|
bc65e40313 | ||
|
|
a188c7d791 | ||
|
|
f2cccdd1fb | ||
|
|
3aef65597b | ||
|
|
c98e007ff7 |
14
.dockerignore
Normal file
14
.dockerignore
Normal file
@@ -0,0 +1,14 @@
|
||||
node_modules
|
||||
**/node_modules
|
||||
src/javascript/jsc/WebKit/LayoutTests
|
||||
zig-out
|
||||
zig-build
|
||||
**/*.o
|
||||
**/*.a
|
||||
|
||||
examples
|
||||
|
||||
**/.next
|
||||
.git
|
||||
src/javascript/jsc/WebKit/WebKitBuild
|
||||
**/CMakeCache.txt
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -3,7 +3,7 @@
|
||||
# url = https://github.com/Hejsil/zig-clap
|
||||
[submodule "src/deps/picohttpparser"]
|
||||
path = src/deps/picohttpparser
|
||||
url = https://github.com/h2o/picohttpparser/
|
||||
url = https://github.com/h2o/picohttpparser.git
|
||||
ignore = dirty
|
||||
[submodule "src/javascript/jsc/WebKit"]
|
||||
path = src/javascript/jsc/WebKit
|
||||
@@ -11,5 +11,5 @@
|
||||
ignore = dirty
|
||||
[submodule "src/deps/mimalloc"]
|
||||
path = src/deps/mimalloc
|
||||
url = https://github.com/microsoft/mimalloc
|
||||
url = https://github.com/microsoft/mimalloc.git
|
||||
ignore = dirty
|
||||
|
||||
104
.vscode/launch.json
vendored
104
.vscode/launch.json
vendored
@@ -5,7 +5,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Transpile small",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
// "/Users/jarred/Desktop/webpack4.js"
|
||||
// "/Users/jarred/Code/bun/examples/css-stress-test/nexty/node_modules/next/dist/build/utils.js"
|
||||
@@ -32,7 +32,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": ".bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"./examples/hello-next/node_modules.server.bun"
|
||||
// "--origin=https://localhost:9000/"
|
||||
@@ -44,7 +44,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Discord",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"discord"
|
||||
// "--origin=https://localhost:9000/"
|
||||
@@ -69,7 +69,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev Launch",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"./simple.css",
|
||||
"--resolve=dev",
|
||||
@@ -79,6 +79,15 @@
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Linux Launch",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-linux-x64/bin/bun-debug",
|
||||
"args": ["--origin=http://jarred-desktop.local:3000/"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "lldb",
|
||||
@@ -94,7 +103,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "args": ["--serve", "--origin=http://localhost:3000"],
|
||||
"args": ["dev", "--origin=http://localhost:3000"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
@@ -114,7 +123,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Lazy Build",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"./src/index.tsx",
|
||||
"--resolve=lazy",
|
||||
@@ -128,7 +137,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Build",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"./src/index.tsx",
|
||||
"--resolve=dev",
|
||||
@@ -143,7 +152,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixture serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
@@ -153,7 +162,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["bun", "--use=bun-framework-next"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
@@ -162,7 +171,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["bun", "./pages/index.js"],
|
||||
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
|
||||
"console": "internalConsole"
|
||||
@@ -172,7 +181,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
|
||||
"console": "internalConsole"
|
||||
@@ -181,7 +190,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Mixed case resolve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"build",
|
||||
"./index.js",
|
||||
@@ -196,7 +205,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Build .bun lotta-modules",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["bun", "./index.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/lotta-modules/",
|
||||
"console": "internalConsole"
|
||||
@@ -205,7 +214,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev CRA",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["dev", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-create-react-app/",
|
||||
"console": "internalConsole"
|
||||
@@ -214,7 +223,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fragment",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
@@ -223,7 +232,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Context Bun Bug",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["bun", "./code.js"],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
@@ -232,16 +241,43 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Context Bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["bun", "--use=next"],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Bun-hello",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/packages/bun-hello",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Integration Test Dev",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/integration/snippets",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Integration Test Dev (no hmr)",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["--disable-hmr"],
|
||||
"cwd": "${workspaceFolder}/integration/snippets",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixtures Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "a",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
@@ -260,7 +296,7 @@
|
||||
|
||||
"request": "launch",
|
||||
"name": "Context Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
@@ -279,16 +315,16 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Debug Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next/bun-framework-next",
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Type-only import",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"bun",
|
||||
"./src/test/fixtures/type-only-import.ts",
|
||||
@@ -301,7 +337,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev lotta-modules",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["dev", "./index.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/lotta-modules/",
|
||||
"console": "internalConsole"
|
||||
@@ -310,7 +346,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Build .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": [
|
||||
"bun",
|
||||
// "./index.js",
|
||||
@@ -325,7 +361,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM Resolve symlink",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["--resolve=dev", "test-pnpm.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/css-stress-test",
|
||||
"console": "internalConsole"
|
||||
@@ -334,7 +370,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Print .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"args": ["./node_modules.bun"],
|
||||
"cwd": "${workspaceFolder}/examples/simple-react",
|
||||
"console": "internalConsole"
|
||||
@@ -363,7 +399,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch (other)",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "args": ["./simple.jsx", "--resolve=disable"],
|
||||
// "cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
// "console": "internalConsole"
|
||||
@@ -372,7 +408,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=disable",
|
||||
@@ -387,7 +423,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -404,7 +440,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -421,7 +457,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// // "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -440,7 +476,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Rome",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"program": "${workspaceFolder}/build/macos-x86_64/bun",
|
||||
// "preLaunchTask": "build",
|
||||
"args": [
|
||||
@@ -462,8 +498,8 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Rome Dev",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
"args": [
|
||||
"--resolve=dev",
|
||||
|
||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -12,6 +12,16 @@
|
||||
"[zig]": {
|
||||
"editor.defaultFormatter": "tiehuis.zig"
|
||||
},
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"integration/snapshots": true,
|
||||
"integration/snapshots-no-hmr": true
|
||||
},
|
||||
"C_Cpp.files.exclude": {
|
||||
"**/.vscode": true,
|
||||
"src/javascript/jsc/WebKit/JSTests": true,
|
||||
|
||||
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM bun-zig:latest
|
||||
|
||||
COPY . /home/ubuntu/bun
|
||||
WORKDIR /home/ubuntu/bun
|
||||
|
||||
RUN make vendor-without-check
|
||||
|
||||
|
||||
52
Dockerfile.zig
Normal file
52
Dockerfile.zig
Normal file
@@ -0,0 +1,52 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common
|
||||
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
||||
|
||||
RUN wget https://apt.llvm.org/llvm.sh --no-check-certificate
|
||||
RUN chmod +x llvm.sh
|
||||
RUN ./llvm.sh 12
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
software-properties-common \
|
||||
cmake \
|
||||
build-essential \
|
||||
git \
|
||||
libssl-dev \
|
||||
ruby \
|
||||
liblld-12-dev \
|
||||
libclang-12-dev \
|
||||
nodejs \
|
||||
gcc \
|
||||
g++ \
|
||||
npm \
|
||||
clang-12 \
|
||||
clang-format-12 \
|
||||
libc++-12-dev \
|
||||
libc++abi-12-dev \
|
||||
lld-12 \
|
||||
libicu-dev
|
||||
|
||||
RUN update-alternatives --install /usr/bin/ld ld /usr/bin/lld-12 90 && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 90 && \
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-12 90 && \
|
||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 90
|
||||
|
||||
|
||||
ENV CC=clang-12
|
||||
ENV CXX=clang++-12
|
||||
|
||||
# Compile zig
|
||||
RUN mkdir -p /home/ubuntu/zig; cd /home/ubuntu; git clone https://github.com/jarred-sumner/zig.git; cd /home/ubuntu/zig && git checkout jarred/zig-sloppy-with-small-structs && cmake . -DCMAKE_BUILD_TYPE=Release && make -j$(nproc)
|
||||
|
||||
ENV PATH="/home/ubuntu/zig:$PATH"
|
||||
|
||||
RUN npm install -g esbuild
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
235
Makefile
235
Makefile
@@ -1,23 +1,53 @@
|
||||
OS_NAME := $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH_NAME_DENORAMLZIED_1 := $(shell uname -m)
|
||||
ARCH_NAME_DENORAMLZIED_2 := $(shell tr '[_]' '[--]' <<< $(ARCH_NAME_DENORAMLZIED_1))
|
||||
ARCH_NAME_DENORAMLZIED_3 := $(shell sed s/x86-64/x64/ <<< $(ARCH_NAME_DENORAMLZIED_2))
|
||||
ARCH_NAME := $(shell sed s/arm64/aarch64/ <<< $(ARCH_NAME_DENORAMLZIED_3))
|
||||
ARCH_NAME_RAW := $(shell uname -m)
|
||||
|
||||
ARCH_NAME :=
|
||||
ifeq ($(ARCH_NAME_RAW),arm64)
|
||||
ARCH_NAME = aarch64
|
||||
else
|
||||
ARCH_NAME = x64
|
||||
endif
|
||||
|
||||
TRIPLET := $(OS_NAME)-$(ARCH_NAME)
|
||||
PACKAGE_DIR := packages/bun-cli-$(TRIPLET)
|
||||
DEBUG_PACKAGE_DIR := packages/debug-bun-cli-$(TRIPLET)
|
||||
PACKAGES_REALPATH := $(shell realpath packages)
|
||||
PACKAGE_DIR := $(PACKAGES_REALPATH)/bun-cli-$(TRIPLET)
|
||||
DEBUG_PACKAGE_DIR := $(PACKAGES_REALPATH)/debug-bun-cli-$(TRIPLET)
|
||||
BIN_DIR := $(PACKAGE_DIR)/bin
|
||||
RELEASE_BUN := $(BIN_DIR)/bun
|
||||
RELEASE_BUN := $(PACKAGE_DIR)/bin/bun
|
||||
DEBUG_BIN := $(DEBUG_PACKAGE_DIR)/bin
|
||||
DEBUG_BIN_REALPATH := $(shell realpath $(DEBUG_PACKAGE_DIR)/bin)
|
||||
DEBUG_BUN := $(shell realpath $(DEBUG_BIN)/bun-debug)
|
||||
DEBUG_BUN := $(DEBUG_BIN)/bun-debug
|
||||
BUILD_ID := $(shell cat ./build-id)
|
||||
PACKAGE_JSON_VERSION := 0.0.$(BUILD_ID)
|
||||
BUN_BUILD_TAG := bun-v$(PACKAGE_JSON_VERSION)
|
||||
CC := clang
|
||||
CXX := clang++
|
||||
|
||||
|
||||
|
||||
STRIP ?= $(shell which llvm-strip || which llvm-strip-12 || echo "Missing llvm-strip. Please pass it in the STRIP environment var"; exit 1;)
|
||||
|
||||
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
HOMEBREW_PREFIX := $(shell brew --prefix)/
|
||||
endif
|
||||
|
||||
bun: vendor build-obj bun-link-lld-release
|
||||
|
||||
vendor: api node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp jsc
|
||||
|
||||
vendor-without-check: api node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp
|
||||
|
||||
vendor: require init-submodules vendor-without-check
|
||||
|
||||
require:
|
||||
@echo "Checking if the required utilities are available..."
|
||||
@realpath --version >/dev/null 2>&1 || (echo "ERROR: realpath is required."; exit 1)
|
||||
@cmake --version >/dev/null 2>&1 || (echo "ERROR: cmake is required."; exit 1)
|
||||
@esbuild --version >/dev/null 2>&1 || (echo "ERROR: esbuild is required."; exit 1)
|
||||
@npm --version >/dev/null 2>&1 || (echo "ERROR: npm is required."; exit 1)
|
||||
|
||||
init-submodules:
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
|
||||
build-obj:
|
||||
zig build obj -Drelease-fast
|
||||
@@ -28,7 +58,11 @@ sign-macos-x64:
|
||||
sign-macos-aarch64:
|
||||
gon sign.macos-aarch64.json
|
||||
|
||||
release-macos: all-js build-obj jsc-bindings-mac bun-link-lld-release
|
||||
release: all-js build-obj jsc-bindings-mac bun-link-lld-release
|
||||
|
||||
release-linux: release strip-debug
|
||||
|
||||
|
||||
|
||||
all-js: runtime_js fallback_decoder bun_error node-fallbacks
|
||||
|
||||
@@ -50,12 +84,49 @@ runtime_js:
|
||||
bun_error:
|
||||
@cd packages/bun-error; npm install; npm run --silent build
|
||||
|
||||
|
||||
DEFAULT_USE_BMALLOC := 1
|
||||
# ifeq ($(OS_NAME),linux)
|
||||
# DEFAULT_USE_BMALLOC = 0
|
||||
# endif
|
||||
|
||||
USE_BMALLOC ?= DEFAULT_USE_BMALLOC
|
||||
|
||||
DEFAULT_JSC_LIB :=
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
DEFAULT_JSC_LIB = ${HOME}/webkit-build/lib
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
DEFAULT_JSC_LIB = src/deps
|
||||
endif
|
||||
|
||||
JSC_LIB ?= $(DEFAULT_JSC_LIB)
|
||||
|
||||
JSC_INCLUDE_DIR ?= ${HOME}/webkit-build/include
|
||||
|
||||
JSC_FILES := $(JSC_LIB)/libJavaScriptCore.a $(JSC_LIB)/libWTF.a
|
||||
|
||||
JSC_BUILD_STEPS :=
|
||||
ifeq ($(OS_NAME),linux)
|
||||
JSC_BUILD_STEPS += jsc-build-linux jsc-copy-headers
|
||||
endif
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
JSC_BUILD_STEPS += jsc-build-mac jsc-copy-headers
|
||||
endif
|
||||
|
||||
# ifeq ($(USE_BMALLOC),1)
|
||||
JSC_FILES += $(JSC_LIB)/libbmalloc.a
|
||||
# endif
|
||||
|
||||
|
||||
jsc: jsc-build jsc-bindings
|
||||
jsc-build: jsc-build-mac jsc-copy-headers
|
||||
jsc-build: $(JSC_BUILD_STEPS)
|
||||
jsc-bindings: jsc-bindings-headers jsc-bindings-mac
|
||||
|
||||
jsc-bindings-headers:
|
||||
mkdir -p src/JavaScript/jsc/bindings-obj/
|
||||
mkdir -p src/javascript/jsc/bindings-obj/
|
||||
zig build headers
|
||||
|
||||
bump:
|
||||
@@ -95,6 +166,9 @@ release-mac-push: write-package-json-version
|
||||
dev-obj:
|
||||
zig build obj
|
||||
|
||||
dev-obj-linux:
|
||||
zig build obj -Dtarget=x86_64-linux-gnu
|
||||
|
||||
dev: mkdir-dev dev-obj bun-link-lld-debug
|
||||
|
||||
mkdir-dev:
|
||||
@@ -104,20 +178,25 @@ test-install:
|
||||
cd integration/scripts && npm install
|
||||
|
||||
test-all: test-install test-with-hmr test-no-hmr
|
||||
|
||||
copy-test-node-modules:
|
||||
rm -rf integration/snippets/package-json-exports/node_modules
|
||||
cp -r integration/snippets/package-json-exports/_node_modules_copy integration/snippets/package-json-exports/node_modules
|
||||
kill-bun:
|
||||
-killall -9 bun bun-debug
|
||||
|
||||
test-with-hmr:
|
||||
-killall bun -9;
|
||||
test-with-hmr: kill-bun copy-test-node-modules
|
||||
BUN_BIN=$(RELEASE_BUN) node integration/scripts/browser.js
|
||||
|
||||
test-no-hmr:
|
||||
test-no-hmr: kill-bun copy-test-node-modules
|
||||
-killall bun -9;
|
||||
DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(RELEASE_BUN) node integration/scripts/browser.js
|
||||
|
||||
test-dev-with-hmr:
|
||||
test-dev-with-hmr: copy-test-node-modules
|
||||
-killall bun-debug -9;
|
||||
BUN_BIN=$(DEBUG_BUN) node integration/scripts/browser.js
|
||||
|
||||
test-dev-no-hmr:
|
||||
test-dev-no-hmr: copy-test-node-modules
|
||||
-killall bun-debug -9;
|
||||
DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(DEBUG_BUN) node integration/scripts/browser.js
|
||||
|
||||
@@ -126,44 +205,61 @@ test-dev-all: test-dev-with-hmr test-dev-no-hmr
|
||||
test-dev: test-dev-with-hmr
|
||||
|
||||
jsc-copy-headers:
|
||||
find src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/JavaScriptCore \;
|
||||
find src/javascript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} src/javascript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/JavaScriptCore/ \;
|
||||
|
||||
jsc-build-mac-compile:
|
||||
cd src/javascript/jsc/WebKit && ICU_INCLUDE_DIRS="$(HOMEBREW_PREFIX)opt/icu4c/include" ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo"
|
||||
|
||||
jsc-build-linux-compile:
|
||||
cd src/javascript/jsc/WebKit && ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo
|
||||
|
||||
cd src/javascript/jsc/WebKit && ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo -DUSE_THIN_ARCHIVES=OFF"
|
||||
|
||||
jsc-build-mac: jsc-build-mac-compile jsc-build-mac-copy
|
||||
|
||||
jsc-build-mac-copy:
|
||||
cp src/JavaScript/jsc/WebKit/WebKitBuild/Release/lib/libJavaScriptCore.a src/deps/libJavaScriptCore.a
|
||||
cp src/JavaScript/jsc/WebKit/WebKitBuild/Release/lib/libWTF.a src/deps/libWTF.a
|
||||
cp src/JavaScript/jsc/WebKit/WebKitBuild/Release/lib/libbmalloc.a src/deps/libbmalloc.a
|
||||
|
||||
JSC_FILES := src/deps/libJavaScriptCore.a \
|
||||
src/deps/libWTF.a \
|
||||
src/deps/libbmalloc.a
|
||||
jsc-build-linux: jsc-build-linux-compile jsc-build-mac-copy
|
||||
|
||||
jsc-build-mac-copy:
|
||||
cp src/javascript/jsc/WebKit/WebKitBuild/Release/lib/libJavaScriptCore.a src/deps/libJavaScriptCore.a
|
||||
cp src/javascript/jsc/WebKit/WebKitBuild/Release/lib/libWTF.a src/deps/libWTF.a
|
||||
cp src/javascript/jsc/WebKit/WebKitBuild/Release/lib/libbmalloc.a src/deps/libbmalloc.a
|
||||
|
||||
clean-bindings:
|
||||
rm -rf $(OBJ_DIR)/*.o
|
||||
|
||||
clean: clean-bindings
|
||||
rm src/deps/*.a src/deps/*.o
|
||||
cd src/deps/mimalloc && make clean;
|
||||
|
||||
|
||||
HOMEBREW_PREFIX := $(shell brew --prefix)/
|
||||
|
||||
SRC_DIR := src/javascript/jsc/bindings
|
||||
OBJ_DIR := src/javascript/jsc/bindings-obj
|
||||
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
|
||||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))
|
||||
INCLUDE_DIRS := -Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders \
|
||||
MAC_INCLUDE_DIRS := -Isrc/javascript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders \
|
||||
-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/WTF/Headers \
|
||||
-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers \
|
||||
-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/ \
|
||||
-Isrc/JavaScript/jsc/bindings/ \
|
||||
-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/ \
|
||||
-Isrc/javascript/jsc/bindings/ \
|
||||
-Isrc/javascript/jsc/WebKit/Source/bmalloc
|
||||
|
||||
LINUX_INCLUDE_DIRS := -I$(JSC_INCLUDE_DIR) \
|
||||
-Isrc/javascript/jsc/bindings/
|
||||
|
||||
INCLUDE_DIRS :=
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
INCLUDE_DIRS += $(LINUX_INCLUDE_DIRS)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
INCLUDE_DIRS += $(MAC_INCLUDE_DIRS)
|
||||
endif
|
||||
|
||||
CLANG_FLAGS := $(INCLUDE_DIRS) \
|
||||
-std=gnu++1z \
|
||||
-stdlib=libc++ \
|
||||
-std=gnu++17 \
|
||||
-DSTATICALLY_LINKED_WITH_JavaScriptCore=1 \
|
||||
-DSTATICALLY_LINKED_WITH_WTF=1 \
|
||||
-DSTATICALLY_LINKED_WITH_BMALLOC=1 \
|
||||
-DBUILDING_WITH_CMAKE=1 \
|
||||
-DNDEBUG=1 \
|
||||
-DNOMINMAX \
|
||||
@@ -171,8 +267,15 @@ CLANG_FLAGS := $(INCLUDE_DIRS) \
|
||||
-g \
|
||||
-DENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0 \
|
||||
-DBUILDING_JSCONLY__ \
|
||||
-DASSERT_ENABLED=0\
|
||||
-DDU_DISABLE_RENAMING=1
|
||||
-DASSERT_ENABLED=0 \
|
||||
-fPIE
|
||||
|
||||
# This flag is only added to webkit builds on Apple platforms
|
||||
# It has something to do with ICU
|
||||
ifeq ($(OS_NAME), darwin)
|
||||
CLANG_FLAGS += -DDU_DISABLE_RENAMING=1
|
||||
endif
|
||||
|
||||
|
||||
jsc-bindings-mac: $(OBJ_FILES)
|
||||
|
||||
@@ -183,59 +286,83 @@ MACOS_ICU_FILES := $(HOMEBREW_PREFIX)opt/icu4c/lib/libicudata.a \
|
||||
|
||||
MACOS_ICU_INCLUDE := $(HOMEBREW_PREFIX)opt/icu4c/include
|
||||
|
||||
MACOS_ICU_FLAGS := -l icucore \
|
||||
ICU_FLAGS :=
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
JSC_BUILD_STEPS += jsc-build-linux jsc-copy-headers
|
||||
ICU_FLAGS += -licuuc -licudata -licui18n
|
||||
endif
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
ICU_FLAGS += -l icucore \
|
||||
$(MACOS_ICU_FILES) \
|
||||
-I$(MACOS_ICU_INCLUDE)
|
||||
endif
|
||||
|
||||
BUN_LLD_FLAGS := $(OBJ_FILES) \
|
||||
${MACOS_ICU_FLAGS} \
|
||||
${ICU_FLAGS} \
|
||||
${JSC_FILES} \
|
||||
src/deps/picohttpparser.o \
|
||||
src/deps/mimalloc/libmimalloc.a \
|
||||
$(CLANG_FLAGS) \
|
||||
-fpie \
|
||||
|
||||
|
||||
ifeq ($(OS_NAME), linux)
|
||||
BUN_LLD_FLAGS += -lstdc++fs \
|
||||
-pthread \
|
||||
-ldl \
|
||||
-lc \
|
||||
-Wl,-z,now \
|
||||
-Wl,--as-needed \
|
||||
-Wl,-z,stack-size=12800000 \
|
||||
-Wl,-z,notext \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-Wl,--gc-sections \
|
||||
-fuse-ld=lld
|
||||
endif
|
||||
|
||||
|
||||
mimalloc:
|
||||
cd src/deps/mimalloc; cmake .; make;
|
||||
|
||||
bun-link-lld-debug:
|
||||
clang++ $(BUN_LLD_FLAGS) \
|
||||
$(CXX) $(BUN_LLD_FLAGS) \
|
||||
-g \
|
||||
$(DEBUG_BIN)/bun-debug.o \
|
||||
-Wl,-dead_strip \
|
||||
-ftls-model=local-exec \
|
||||
-flto \
|
||||
-o $(DEBUG_BIN)/bun-debug
|
||||
-W \
|
||||
-o $(DEBUG_BIN)/bun-debug \
|
||||
|
||||
bun-link-lld-release:
|
||||
clang++ $(BUN_LLD_FLAGS) \
|
||||
$(CXX) $(BUN_LLD_FLAGS) \
|
||||
$(BIN_DIR)/bun.o \
|
||||
-o $(BIN_DIR)/bun \
|
||||
-Wl,-dead_strip \
|
||||
-ftls-model=local-exec \
|
||||
-W \
|
||||
-flto \
|
||||
-ftls-model=initial-exec \
|
||||
-O3
|
||||
cp $(BIN_DIR)/bun $(BIN_DIR)/bun-profile
|
||||
$(STRIP) $(BIN_DIR)/bun
|
||||
rm $(BIN_DIR)/bun.o
|
||||
|
||||
bun-link-lld-release-aarch64:
|
||||
clang++ $(BUN_LLD_FLAGS) \
|
||||
$(CXX) $(BUN_LLD_FLAGS) \
|
||||
build/macos-aarch64/bun.o \
|
||||
-o build/macos-aarch64/bun \
|
||||
-Wl,-dead_strip \
|
||||
-ftls-model=local-exec \
|
||||
-ftls-model=initial-exec \
|
||||
-flto \
|
||||
-O3
|
||||
|
||||
# We do this outside of build.zig for performance reasons
|
||||
# The C compilation stuff with build.zig is really slow and we don't need to run this as often as the rest
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
clang++ -c -o $@ $< \
|
||||
$(CXX) -c -o $@ $< \
|
||||
$(CLANG_FLAGS) \
|
||||
-O1
|
||||
|
||||
sizegen:
|
||||
clang++ src/javascript/jsc/headergen/sizegen.cpp -o /tmp/sizegen $(CLANG_FLAGS) -O1
|
||||
$(CXX) src/javascript/jsc/headergen/sizegen.cpp -o /tmp/sizegen $(CLANG_FLAGS) -O1
|
||||
/tmp/sizegen > src/javascript/jsc/bindings/sizes.zig
|
||||
|
||||
picohttp:
|
||||
clang -O3 -g -c src/deps/picohttpparser.c -Isrc/deps -o src/deps/picohttpparser.o; cd ../../
|
||||
|
||||
$(CC) -O3 -g -fPIE -c src/deps/picohttpparser.c -Isrc/deps -o src/deps/picohttpparser.o; cd ../../
|
||||
|
||||
116
README.md
116
README.md
@@ -125,7 +125,7 @@ Bun is a project with incredibly large scope, and it's early days.
|
||||
|
||||
| Feature | In |
|
||||
| ---------------------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| Symlinks | Resolver |
|
||||
| ~Symlinks~ | Resolver |
|
||||
| [Finish Fast Refresh](https://github.com/Jarred-Sumner/bun/issues/18) | JSX Transpiler |
|
||||
| Source Maps | JavaScript |
|
||||
| Source Maps | CSS |
|
||||
@@ -411,6 +411,111 @@ For developing frameworks, you can also do `bun bun --use ./relative-path-to-fra
|
||||
|
||||
If you're interested in adding a framework integration, please reach out. There's a lot here and it's not entirely documented yet.
|
||||
|
||||
# Reference
|
||||
|
||||
### `bun bun`
|
||||
|
||||
Run `bun bun ./path-to.js` to generate a `node_modules.bun` file containing all imported dependencies (recursively).
|
||||
|
||||
**Why bundle?**
|
||||
|
||||
- For browsers, loading entire apps without bundling dependencies is typically slow. With a fast bundler & transpiler, the bottleneck eventually becomes the web browser's ability to run many network requests concurrently. There are many workarounds for this. `<link rel="modulepreload">`, HTTP/3, etc but none are more effective than bundling. If you have reproducible evidence to the contrary, feel free to submit an issue. It would be better if bundling wasn't necessary.
|
||||
- On the server, bundling reduces the number of filesystem lookups to load JavaScript. While filesystem lookups are faster than HTTP requests, there's still overhead.
|
||||
|
||||
**What is `.bun`?**
|
||||
|
||||
The `.bun` file contains:
|
||||
|
||||
- all the bundled source code
|
||||
- all the bundled source code metadata
|
||||
- project metadata & configuration
|
||||
|
||||
Here are some of the questions `.bun` files answer:
|
||||
|
||||
- when I import `react/index.js`, where in the `.bun` is the code for that? (not resolving, just the code)
|
||||
- what modules of a package are used?
|
||||
- what framework is used? (e.g. Next.js)
|
||||
- where is the routes directory?
|
||||
- how big is each imported dependency?
|
||||
- what is the hash of the bundle's contents? (for etags)
|
||||
- what is the name & version of every npm package exported in this bundle?
|
||||
- what modules from which packages are used in this project? ("project" defined as all the entry points used to generate the .bun)
|
||||
|
||||
All in one file.
|
||||
|
||||
It's a little like a build cache, but designed for reuse. I hope people will eventually check it into version control so their coworkers don't have to run `npm install` as often.
|
||||
|
||||
##### Position-independent code
|
||||
|
||||
From a design perspective, the most important part of the `.bun` format is how code is organized. Each module is exported by a hash like this:
|
||||
|
||||
```js
|
||||
// preact/dist/preact.module.js
|
||||
export var $eb6819b = $$m({
|
||||
"preact/dist/preact.module.js": (module, exports) => {
|
||||
var n, l, u, i, t, o, r, f, e = {}, c = [], s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
||||
// ... rest of code
|
||||
```
|
||||
|
||||
This makes bundled modules [position-independent](https://en.wikipedia.org/wiki/Position-independent_code). In theory, one could import only the exact modules in-use without reparsing code and without generating a new bundle. One bundle can dynamically become many bundles comprising only the modules in use on the webpage. Thanks to the metadata with the byte offsets, a web server can send each module to browsers [zero-copy](https://en.wikipedia.org/wiki/Zero-copy) using [sendfile](https://man7.org/linux/man-pages/man2/sendfile.2.html). Bun itself is not quite this smart yet, but these optimizations would be useful in production and potentially very useful for React Server Components.
|
||||
|
||||
To see the schema inside, have a look at [`JavascriptBundleContainer`](./src/api/schema.d.ts#:~:text=export%20interface-,JavascriptBundleContainer,-%7B). You can find JavaScript bindings to read the metadata in [src/api/schema.js](./src/api/schema.js). This is not really an API yet. It's missing the part where it gets the binary data from the bottom of the file. Someday, I want this to be usable by other tools too.
|
||||
|
||||
**Where is the code?**
|
||||
|
||||
`.bun` files are marked as executable.
|
||||
|
||||
To print out the code, run `./node_modules.bun` in your terminal or run `bun ./path-to-node_modules.bun`.
|
||||
|
||||
Here is a copy-pastable example:
|
||||
|
||||
```bash
|
||||
./node_modules.bun > node_modules.js
|
||||
```
|
||||
|
||||
This works because every `.bun` file starts with this:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bun
|
||||
```
|
||||
|
||||
To deploy to production with Bun, you'll want to get the code from the `.bun` file and stick that somewhere your web server can find it (or if you're using Vercel or a Rails app, in a `public` folder).
|
||||
|
||||
Note that `.bun` is a binary file format, so just opening it in VSCode or vim might render strangely.
|
||||
|
||||
**Advanced**
|
||||
|
||||
By default, `bun bun` only bundles external dependencies that are `import`ed or `require`d in either app code or another external dependency. An "external depenendency" is defined as, "A JavaScript-like file that has `/node_modules/` in the resolved file path and a corresponding `package.json`".
|
||||
|
||||
To force bun to bundle packages which are not located in a `node_modules` folder (i.e. the final, resolved path following all symlinks), add a `bun` section to the root project's `package.json` with `alwaysBundle` set to an array of package names to always bundle. Here's an example:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-package-name-in-here",
|
||||
"bun": {
|
||||
"alwaysBundle": ["@mybigcompany/my-workspace-package"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Bundled dependencies are not eligible for Hot Module Reloading. The code is served to browsers & Bun.js verbatim. But, in the future, it may be sectioned off into only parts of the bundle being used. That's possible in the current version of the `.bun` file (so long as you know which files are necessary), but it's not implemented yet. Longer-term, it will include all `import` and `export` of each module inside.
|
||||
|
||||
**What is the module ID hash?**
|
||||
|
||||
The `$eb6819b` hash used here:
|
||||
|
||||
```js
|
||||
export var $eb6819b = $$m({
|
||||
```
|
||||
|
||||
Is generated like this:
|
||||
|
||||
1. Murmur3 32 bit hash of `package.name@package.version`. This is the hash uniquely identifying the npm package.
|
||||
2. Wyhash 64 of the `package.hash` + `package_path`. `package_path` means "relative to the root of the npm package, where is the module imported?". For example, if you imported `react/jsx-dev-runtime.js`, the `package_path` is `jsx-dev-runtime.js`. `react-dom/cjs/react-dom.development.js` would be `cjs/react-dom.development.js`
|
||||
3. Truncate the hash generated above to a `u32`
|
||||
|
||||
The implementation details of this module ID hash will vary between versions of Bun. The important part is the metadata contains the module IDs, the package paths, and the package hashes so it shouldn't really matter in practice if other tooling wants to make use of any of this.
|
||||
|
||||
# Credits
|
||||
|
||||
- While written in Zig instead of Go, Bun's JS transpiler, CSS lexer, and node module resolver source code is based off of @evanw's esbuild project. @evanw did a fantastic job with esbuild.
|
||||
@@ -469,6 +574,8 @@ For compatibiltiy reasons, these NPM packages are embedded into Bun's binary and
|
||||
|
||||
Estimated: 30-90 minutes :(
|
||||
|
||||
## macOS
|
||||
|
||||
Compile Zig:
|
||||
|
||||
```bash
|
||||
@@ -485,11 +592,12 @@ In `bun`:
|
||||
```bash
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
make vendor
|
||||
zig build headers
|
||||
make jsc-bindings-mac
|
||||
zig build -Drelease-fast
|
||||
```
|
||||
|
||||
Note that `brew install zig` won't work. Bun uses a build of Zig with a couple patches.
|
||||
|
||||
Additionally, you'll need `cmake`, `npm` and `esbuild` installed globally.
|
||||
|
||||
## Linux
|
||||
|
||||
Compile Zig:
|
||||
25
build.zig
25
build.zig
@@ -237,9 +237,13 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
true,
|
||||
);
|
||||
|
||||
|
||||
step.addObjectFile("src/deps/libJavaScriptCore.a");
|
||||
step.addObjectFile("src/deps/libWTF.a");
|
||||
step.addObjectFile("src/deps/libbmalloc.a");
|
||||
|
||||
if (target.getOs().tag != .linux) {
|
||||
step.addObjectFile("src/deps/libbmalloc.a");
|
||||
}
|
||||
|
||||
step.addObjectFile("src/deps/mimalloc/libmimalloc.a");
|
||||
step.addLibPath("src/deps/mimalloc");
|
||||
@@ -261,6 +265,10 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
step.linkSystemLibrary("icucore");
|
||||
step.addLibPath(homebrew_prefix ++ "opt/icu4c/lib");
|
||||
step.addIncludeDir(homebrew_prefix ++ "opt/icu4c/include");
|
||||
} else {
|
||||
step.linkSystemLibrary("icuuc");
|
||||
step.linkSystemLibrary("icudata");
|
||||
step.linkSystemLibrary("icui18n");
|
||||
}
|
||||
|
||||
for (bindings_files.items) |binding| {
|
||||
@@ -272,7 +280,7 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
|
||||
var obj_step = b.step("obj", "Build Bun as a .o file");
|
||||
var obj = b.addObject(bun_executable_name, exe.root_src.?.path);
|
||||
obj.bundle_compiler_rt = true;
|
||||
obj.setTarget(target);
|
||||
addPicoHTTP(obj, false);
|
||||
obj.addPackage(.{
|
||||
.name = "clap",
|
||||
@@ -282,7 +290,18 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
obj_step.dependOn(&obj.step);
|
||||
obj.setOutputDir(output_dir);
|
||||
obj.setBuildMode(mode);
|
||||
obj.setTarget(target);
|
||||
obj.linkLibC();
|
||||
obj.linkLibCpp();
|
||||
|
||||
obj.bundle_compiler_rt = true;
|
||||
|
||||
if (target.getOsTag() == .linux) {
|
||||
// obj.want_lto = tar;
|
||||
obj.link_emit_relocs = true;
|
||||
obj.link_function_sections = true;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
b.default_step.dependOn(&exe.step);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/standalone": "^7.15.3",
|
||||
"@types/react": "^17.0.19",
|
||||
"bun-framework-next": "^0.0.0-18",
|
||||
"bun-framework-next": "^0.0.0-21",
|
||||
"typescript": "^4.3.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ import styles from "../styles/Home.module.css";
|
||||
|
||||
export async function getStaticProps(ctx) {
|
||||
return {
|
||||
props: {
|
||||
},
|
||||
props: {},
|
||||
};
|
||||
}
|
||||
|
||||
export default function Home({ }) {
|
||||
export default function Home({}) {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Head>
|
||||
@@ -21,7 +20,7 @@ export default function Home({ }) {
|
||||
|
||||
<main className={styles.main}>
|
||||
<h1 className={styles.title}>
|
||||
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||
Welcome!!to <a href="https://nextjs.org">Next.js!</a>
|
||||
</h1>
|
||||
|
||||
<p className={styles.description}>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@import url("./2.css");
|
||||
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
min-height: 99vh;
|
||||
padding: 0 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -8,6 +9,7 @@
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.main {
|
||||
padding: 5rem 0;
|
||||
flex: 1;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import "three/three1";
|
||||
import "three/three2";
|
||||
import "three/three3";
|
||||
import "three/three4";
|
||||
import "three/three5";
|
||||
import "three/three6";
|
||||
import "three/three7";
|
||||
import "three/three8";
|
||||
import "three/three9";
|
||||
import "three/three10";
|
||||
import "three/three1.js";
|
||||
import "three/three2.js";
|
||||
import "three/three3.js";
|
||||
import "three/three4.js";
|
||||
import "three/three5.js";
|
||||
import "three/three6.js";
|
||||
import "three/three7.js";
|
||||
import "three/three8.js";
|
||||
import "three/three9.js";
|
||||
import "three/three10.js";
|
||||
// import "@babel/standalone/babel";
|
||||
|
||||
@@ -6,6 +6,25 @@
|
||||
"@babel/standalone": "^7.15.3",
|
||||
"lodash": "^4.17.21",
|
||||
"three.js": "^0.77.1",
|
||||
"underscore": "^1.13.1"
|
||||
"underscore": "^1.13.1",
|
||||
"webpack": "^5.56.0"
|
||||
},
|
||||
"type": "module",
|
||||
"browserslist": [
|
||||
"last 1 version"
|
||||
],
|
||||
"scripts": {
|
||||
"generate": "cp node_modules/three/three.js node_modules/three/three1.js; cp node_modules/three/three.js node_modules/three/three2.js; cp node_modules/three/three.js node_modules/three/three3.js; cp node_modules/three/three.js node_modules/three/three4.js; cp node_modules/three/three.js node_modules/three/three5.js; cp node_modules/three/three.js node_modules/three/three6.js; cp node_modules/three/three.js node_modules/three/three7.js; cp node_modules/three/three.js node_modules/three/three8.js; cp node_modules/three/three.js node_modules/three/three9.js; cp node_modules/three/three.js node_modules/three/three10.js",
|
||||
"bench": "hyperfine \"bun bun ./index.js\" \"GOMAXPROCS=1 bun bun ./index.js\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --no-swcrc -s false -o /tmp/out.swc.js\" \"node_modules/.bin/parcel build --no-optimize --no-source-maps --no-content-hash --no-cache --no-autoinstall ./index.js\" --prepare=\"rm -rf dist *.bun .parcel-cache;\"",
|
||||
"bench-sync": "hyperfine \"GOMAXPROCS=1 bun bun ./index.js\" \"GOMAXPROCS=1 esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --sync --no-swcrc -s false -o /tmp/out.swc.js\" --prepare=\"rm -rf *.bun\" ",
|
||||
"bench-all": "hyperfine \"bun bun ./index.js\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --no-swcrc -s false -o /tmp/out.swc.js\" \"GOMAXPROCS=1 bun bun ./index.js\" \"GOMAXPROCS=1 esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --sync --no-swcrc -s false -o /tmp/out.swc.js\" --prepare=\"rm -rf *.bun\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@parcel/core": "^2.0.0-rc.0",
|
||||
"babel-loader": "^8.2.2",
|
||||
"parcel": "^2.0.0-rc.0",
|
||||
"webpack-cli": "^4.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
33
examples/macros/components/covid19.tsx
Normal file
33
examples/macros/components/covid19.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { fetchCSV } from "macro:fetchCSV";
|
||||
|
||||
export const Covid19 = () => {
|
||||
const rows = fetchCSV(
|
||||
"https://covid19.who.int/WHO-COVID-19-global-data.csv",
|
||||
{
|
||||
last: 100,
|
||||
columns: ["New_cases", "Date_reported", "Country"],
|
||||
}
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Covid-19</h2>
|
||||
<h6>last {rows.length} updates from the WHO</h6>
|
||||
<div className="Table">
|
||||
<div className="Header">
|
||||
<div className="Heading">New Cases</div>
|
||||
<div className="Heading">Date</div>
|
||||
<div className="Heading">Country</div>
|
||||
</div>
|
||||
|
||||
{rows.map((row, index) => (
|
||||
<div className="Row" key={index}>
|
||||
<div className="Column">{row[0]}</div>
|
||||
<div className="Column">{row[1]}</div>
|
||||
<div className="Column">{row[2]}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
17
examples/macros/components/example.jsx
Normal file
17
examples/macros/components/example.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
// source code
|
||||
import { matchInFile } from "macro:matchInFile";
|
||||
|
||||
export const IPAddresses = () => (
|
||||
<div>
|
||||
<h2>recent ip addresses</h2>
|
||||
<div className="Lines">
|
||||
{matchInFile("access.log", /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}/).map(
|
||||
(ipAddress, index) => (
|
||||
<div className="Line" key={index}>
|
||||
{ipAddress}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
15
examples/macros/components/index.tsx
Normal file
15
examples/macros/components/index.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as ReactDOM from "react-dom";
|
||||
import * as React from "react";
|
||||
import { IPAddresses } from "./example";
|
||||
import { Covid19 } from "./covid19";
|
||||
|
||||
const Start = function () {
|
||||
const root = document.createElement("div");
|
||||
document.body.appendChild(root);
|
||||
|
||||
// comment out to switch between examples
|
||||
ReactDOM.render(<IPAddresses />, root);
|
||||
// ReactDOM.render(<Covid19 />, root);
|
||||
};
|
||||
|
||||
Start();
|
||||
4
examples/macros/example.js
Normal file
4
examples/macros/example.js
Normal file
@@ -0,0 +1,4 @@
|
||||
// source code
|
||||
import { mysteryBox } from "macro:./mystery-box";
|
||||
|
||||
export default "You roll! " + mysteryBox(123);
|
||||
54
examples/macros/fetchCSV.tsx
Normal file
54
examples/macros/fetchCSV.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import Pappa from "papaparse";
|
||||
// Example usage:
|
||||
// const rows = fetchCSV(
|
||||
// "https://covid19.who.int/WHO-COVID-19-global-data.csv",
|
||||
// {
|
||||
// last: 100,
|
||||
// columns: ["New_cases", "Date_reported", "Country"],
|
||||
// }
|
||||
// );
|
||||
export async function fetchCSV(callExpression) {
|
||||
console.time("fetchCSV Total");
|
||||
const [
|
||||
urlNode,
|
||||
{
|
||||
properties: { last: limit = 10, columns = [] },
|
||||
},
|
||||
] = callExpression.arguments;
|
||||
const url = urlNode.get();
|
||||
|
||||
console.time("Fetch");
|
||||
const response = await fetch(url);
|
||||
const csvText = await response.text();
|
||||
console.timeEnd("Fetch");
|
||||
|
||||
console.time("Parse");
|
||||
let rows = Pappa.parse(csvText, { fastMode: true }).data;
|
||||
console.timeEnd("Parse");
|
||||
|
||||
console.time("Render");
|
||||
const columnIndices = new Array(columns.length);
|
||||
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
columnIndices[i] = rows[0].indexOf(columns[i]);
|
||||
}
|
||||
|
||||
rows = rows
|
||||
.slice(Math.max(limit, rows.length) - limit)
|
||||
.reverse()
|
||||
.filter((columns) => columns.every(Boolean));
|
||||
const value = (
|
||||
<array>
|
||||
{rows.map((columns) => (
|
||||
<array>
|
||||
{columnIndices.map((columnIndex) => (
|
||||
<string value={columns[columnIndex]} />
|
||||
))}
|
||||
</array>
|
||||
))}
|
||||
</array>
|
||||
);
|
||||
console.timeEnd("Render");
|
||||
console.timeEnd("fetchCSV Total");
|
||||
return value;
|
||||
}
|
||||
23
examples/macros/matchInFile.tsx
Normal file
23
examples/macros/matchInFile.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
// macro code
|
||||
export function matchInFile(callExpression: BunAST.CallExpression) {
|
||||
const [filePathNode, matcherNode] = callExpression.arguments;
|
||||
let filePath: string;
|
||||
filePath = filePathNode.get();
|
||||
|
||||
let matcher: RegExp;
|
||||
matcher = matcherNode.get();
|
||||
const file: string = Bun.readFile(Bun.cwd + filePath);
|
||||
|
||||
return (
|
||||
<array>
|
||||
{file
|
||||
.split("\n")
|
||||
.map((line) => line.match(matcher))
|
||||
.filter(Boolean)
|
||||
.reverse()
|
||||
.map((line) => (
|
||||
<string value={line[0]} />
|
||||
))}
|
||||
</array>
|
||||
);
|
||||
}
|
||||
10
examples/macros/now.tsx
Normal file
10
examples/macros/now.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import moment from "moment";
|
||||
export function now(node) {
|
||||
var fmt = "HH:mm:ss";
|
||||
const args = node.arguments;
|
||||
if (args[0] instanceof <string />) {
|
||||
fmt = args[0].get();
|
||||
}
|
||||
const time = moment().format(fmt);
|
||||
return <string value={time}></string>;
|
||||
}
|
||||
17
examples/macros/package.json
Normal file
17
examples/macros/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "macros",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"moment": "^2.29.1",
|
||||
"papaparse": "^5.3.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-refresh": "^0.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^17.0.24",
|
||||
"@types/react-dom": "^17.0.9"
|
||||
}
|
||||
}
|
||||
14
examples/macros/public/index.html
Normal file
14
examples/macros/public/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Macro test</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link rel="stylesheet" href="/styles.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script async type="module" src="/components/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
47
examples/macros/styles.css
Normal file
47
examples/macros/styles.css
Normal file
@@ -0,0 +1,47 @@
|
||||
html {
|
||||
font-size: 4rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: black;
|
||||
|
||||
color: rgb(0, 255, 0);
|
||||
font-family: "Courier";
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 48px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.Line {
|
||||
font-size: 0.5rem;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.Table {
|
||||
display: grid;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.Row,
|
||||
.Header {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr 1fr;
|
||||
text-align: right;
|
||||
|
||||
column-gap: 2rem;
|
||||
}
|
||||
|
||||
.Heading {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.Header {
|
||||
border-bottom: 1px solid rgb(0, 255, 0);
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.Heading:nth-of-type(2) {
|
||||
text-align: left;
|
||||
}
|
||||
7
examples/macros/tsconfig.json
Normal file
7
examples/macros/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {},
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ const bunProcess = child_process.spawn(bunExec, bunFlags, {
|
||||
shell: false,
|
||||
});
|
||||
console.log("$", bunExec, bunFlags.join(" "));
|
||||
const isDebug = bunExec.endsWith("-debug");
|
||||
|
||||
bunProcess.stderr.pipe(process.stderr);
|
||||
bunProcess.stdout.pipe(process.stdout);
|
||||
@@ -32,12 +33,27 @@ process.on("beforeExit", () => {
|
||||
});
|
||||
|
||||
function writeSnapshot(name, code) {
|
||||
const file = path.join(
|
||||
__dirname,
|
||||
"../snapshots" + (DISABLE_HMR ? "-no-hmr" : ""),
|
||||
name
|
||||
let file = path.join(__dirname, "../snapshots", name);
|
||||
|
||||
if (!DISABLE_HMR) {
|
||||
file =
|
||||
file.substring(0, file.length - path.extname(file).length) +
|
||||
".hmr" +
|
||||
path.extname(file);
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.dirname(file))) {
|
||||
fs.mkdirSync(path.dirname(file), { recursive: true });
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
isDebug
|
||||
? file.substring(0, file.length - path.extname(file).length) +
|
||||
".debug" +
|
||||
path.extname(file)
|
||||
: file,
|
||||
code
|
||||
);
|
||||
fs.writeFileSync(file, code);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
@@ -91,7 +107,21 @@ async function main() {
|
||||
"/export.js",
|
||||
"/type-only-imports.ts",
|
||||
"/global-is-remapped-to-globalThis.js",
|
||||
"/multiple-imports.js",
|
||||
"/ts-fallback-rewrite-works.js",
|
||||
"/tsx-fallback-rewrite-works.js",
|
||||
"/lodash-regexp.js",
|
||||
"/unicode-identifiers.js",
|
||||
"/string-escapes.js",
|
||||
"/package-json-exports/index.js",
|
||||
"/array-args-with-default-values.js",
|
||||
"/forbid-in-is-correct.js",
|
||||
"/code-simplification-neql-define.js",
|
||||
"/spread_with_key.tsx",
|
||||
"/styledcomponents-output.js",
|
||||
"/void-shouldnt-delete-call-expressions.js",
|
||||
];
|
||||
tests.reverse();
|
||||
|
||||
for (let test of tests) {
|
||||
await runPage(test);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
*.js
|
||||
@@ -0,0 +1,25 @@
|
||||
var lines;
|
||||
const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d
|
||||
}));
|
||||
export function test() {
|
||||
let ran = false;
|
||||
lines = [
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined]
|
||||
];
|
||||
for (let foo of data()) {
|
||||
console.assert(foo.a === null);
|
||||
console.assert(foo.b === null);
|
||||
console.assert(foo.c === null);
|
||||
console.assert(foo.d === null);
|
||||
ran = true;
|
||||
}
|
||||
console.assert(ran);
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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(3474597122, "array-args-with-default-values.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var lines;
|
||||
const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d
|
||||
}));
|
||||
function test() {
|
||||
let ran = false;
|
||||
lines = [
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined]
|
||||
];
|
||||
for (let foo of data()) {
|
||||
console.assert(foo.a === null);
|
||||
console.assert(foo.b === null);
|
||||
console.assert(foo.c === null);
|
||||
console.assert(foo.d === null);
|
||||
ran = true;
|
||||
}
|
||||
console.assert(ran);
|
||||
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
|
||||
};
|
||||
47
integration/snapshots/array-args-with-default-values.hmr.js
Normal file
47
integration/snapshots/array-args-with-default-values.hmr.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
__HMRModule as HMR
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import {
|
||||
__HMRClient as Bun
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(186686614, "array-args-with-default-values.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var lines;
|
||||
const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d
|
||||
}));
|
||||
function test() {
|
||||
let ran = false;
|
||||
lines = [
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined]
|
||||
];
|
||||
for (let foo of data()) {
|
||||
console.assert(foo.a === null);
|
||||
console.assert(foo.b === null);
|
||||
console.assert(foo.c === null);
|
||||
console.assert(foo.d === null);
|
||||
ran = true;
|
||||
}
|
||||
console.assert(ran);
|
||||
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
|
||||
};
|
||||
25
integration/snapshots/array-args-with-default-values.js
Normal file
25
integration/snapshots/array-args-with-default-values.js
Normal file
@@ -0,0 +1,25 @@
|
||||
var lines;
|
||||
const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d
|
||||
}));
|
||||
export function test() {
|
||||
let ran = false;
|
||||
lines = [
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined]
|
||||
];
|
||||
for (let foo of data()) {
|
||||
console.assert(foo.a === null);
|
||||
console.assert(foo.b === null);
|
||||
console.assert(foo.c === null);
|
||||
console.assert(foo.d === null);
|
||||
ran = true;
|
||||
}
|
||||
console.assert(ran);
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
30
integration/snapshots/bundled-entry-point.hmr.debug.js
Normal file
30
integration/snapshots/bundled-entry-point.hmr.debug.js
Normal file
@@ -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
|
||||
};
|
||||
30
integration/snapshots/bundled-entry-point.hmr.js
Normal file
30
integration/snapshots/bundled-entry-point.hmr.js
Normal file
@@ -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 $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(2355916096, "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
|
||||
};
|
||||
@@ -1,30 +1,9 @@
|
||||
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);
|
||||
import * as $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var hello = null ?? "world";
|
||||
|
||||
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
|
||||
};
|
||||
export function test() {
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ 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) {
|
||||
@@ -16,9 +18,11 @@ 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);
|
||||
@@ -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");
|
||||
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@ 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) {
|
||||
@@ -16,15 +18,17 @@ 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;
|
||||
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");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
var testFailed = false;
|
||||
const invariant = () => {
|
||||
testFailed = true;
|
||||
};
|
||||
var $$m = (arg) => {
|
||||
var module = {exports: {} }, exports = module.exports;
|
||||
return arg(module, exports);
|
||||
};
|
||||
var size = 100, ttl = 3600;
|
||||
export var $f332019d = $$m({
|
||||
"relay-runtime/lib/network/RelayQueryResponseCache.js": (module, exports) => {
|
||||
var RelayQueryResponseCache = function() {
|
||||
var foo = function RelayQueryResponseCache(_ref) {
|
||||
var size = _ref.size, ttl = _ref.ttl;
|
||||
!(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got " + "`%s`.", size);
|
||||
!(ttl > 0) && invariant(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl);
|
||||
};
|
||||
foo({size: 100, ttl: 3600 });
|
||||
};
|
||||
RelayQueryResponseCache();
|
||||
}
|
||||
}["relay-runtime/lib/network/RelayQueryResponseCache.js"]);
|
||||
export function test() {
|
||||
var foo = () => result;
|
||||
if (testFailed)
|
||||
throw new Error("invariant should not be called");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
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(726376257, "code-simplification-neql-define.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var testFailed = false;
|
||||
const invariant = () => {
|
||||
testFailed = true;
|
||||
};
|
||||
var $$m = (arg) => {
|
||||
var module = {exports: {} }, exports = module.exports;
|
||||
return arg(module, exports);
|
||||
};
|
||||
var size = 100, ttl = 3600;
|
||||
var $f332019d = $$m({
|
||||
"relay-runtime/lib/network/RelayQueryResponseCache.js": (module, exports) => {
|
||||
var RelayQueryResponseCache = function() {
|
||||
var foo = function RelayQueryResponseCache(_ref) {
|
||||
var size = _ref.size, ttl = _ref.ttl;
|
||||
!(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got " + "`%s`.", size);
|
||||
!(ttl > 0) && invariant(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl);
|
||||
};
|
||||
foo({size: 100, ttl: 3600 });
|
||||
};
|
||||
RelayQueryResponseCache();
|
||||
}
|
||||
}["relay-runtime/lib/network/RelayQueryResponseCache.js"]);
|
||||
function test() {
|
||||
var foo = () => result;
|
||||
if (testFailed)
|
||||
throw new Error("invariant should not be called");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
$f332019d: () => $f332019d,
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_$f332019d = hmr.exports.$f332019d, $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_$f332019d = exports.$f332019d;
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_$f332019d as $f332019d,
|
||||
$$hmr_test as test
|
||||
};
|
||||
53
integration/snapshots/code-simplification-neql-define.hmr.js
Normal file
53
integration/snapshots/code-simplification-neql-define.hmr.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import {
|
||||
__HMRModule as HMR
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import {
|
||||
__HMRClient as Bun
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(1142302163, "code-simplification-neql-define.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var testFailed = false;
|
||||
const invariant = () => {
|
||||
testFailed = true;
|
||||
};
|
||||
var $$m = (arg) => {
|
||||
var module = {exports: {} }, exports = module.exports;
|
||||
return arg(module, exports);
|
||||
};
|
||||
var size = 100, ttl = 3600;
|
||||
var $f332019d = $$m({
|
||||
"relay-runtime/lib/network/RelayQueryResponseCache.js": (module, exports) => {
|
||||
var RelayQueryResponseCache = function() {
|
||||
var foo = function RelayQueryResponseCache(_ref) {
|
||||
var size = _ref.size, ttl = _ref.ttl;
|
||||
!(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got " + "`%s`.", size);
|
||||
!(ttl > 0) && invariant(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl);
|
||||
};
|
||||
foo({size: 100, ttl: 3600 });
|
||||
};
|
||||
RelayQueryResponseCache();
|
||||
}
|
||||
}["relay-runtime/lib/network/RelayQueryResponseCache.js"]);
|
||||
function test() {
|
||||
var foo = () => result;
|
||||
if (testFailed)
|
||||
throw new Error("invariant should not be called");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
$f332019d: () => $f332019d,
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_$f332019d = hmr.exports.$f332019d, $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_$f332019d = exports.$f332019d;
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_$f332019d as $f332019d,
|
||||
$$hmr_test as test
|
||||
};
|
||||
28
integration/snapshots/code-simplification-neql-define.js
Normal file
28
integration/snapshots/code-simplification-neql-define.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var testFailed = false;
|
||||
const invariant = () => {
|
||||
testFailed = true;
|
||||
};
|
||||
var $$m = (arg) => {
|
||||
var module = {exports: {} }, exports = module.exports;
|
||||
return arg(module, exports);
|
||||
};
|
||||
var size = 100, ttl = 3600;
|
||||
export var $f332019d = $$m({
|
||||
"relay-runtime/lib/network/RelayQueryResponseCache.js": (module, exports) => {
|
||||
var RelayQueryResponseCache = function() {
|
||||
var foo = function RelayQueryResponseCache(_ref) {
|
||||
var size = _ref.size, ttl = _ref.ttl;
|
||||
!(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got " + "`%s`.", size);
|
||||
!(ttl > 0) && invariant(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl);
|
||||
};
|
||||
foo({size: 100, ttl: 3600 });
|
||||
};
|
||||
RelayQueryResponseCache();
|
||||
}
|
||||
}["relay-runtime/lib/network/RelayQueryResponseCache.js"]);
|
||||
export function test() {
|
||||
var foo = () => result;
|
||||
if (testFailed)
|
||||
throw new Error("invariant should not be called");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
74
integration/snapshots/export.hmr.debug.js
Normal file
74
integration/snapshots/export.hmr.debug.js
Normal file
@@ -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";
|
||||
74
integration/snapshots/export.hmr.js
Normal file
74
integration/snapshots/export.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(4033101122, "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";
|
||||
@@ -1,74 +1,31 @@
|
||||
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 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);
|
||||
}
|
||||
|
||||
8
integration/snapshots/forbid-in-is-correct.debug.js
Normal file
8
integration/snapshots/forbid-in-is-correct.debug.js
Normal file
@@ -0,0 +1,8 @@
|
||||
var foo = () => {
|
||||
var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports);
|
||||
return D;
|
||||
};
|
||||
export function test() {
|
||||
foo();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
30
integration/snapshots/forbid-in-is-correct.hmr.debug.js
Normal file
30
integration/snapshots/forbid-in-is-correct.hmr.debug.js
Normal file
@@ -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(346837007, "forbid-in-is-correct.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var foo = () => {
|
||||
var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports);
|
||||
return D;
|
||||
};
|
||||
function test() {
|
||||
foo();
|
||||
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
|
||||
};
|
||||
30
integration/snapshots/forbid-in-is-correct.hmr.js
Normal file
30
integration/snapshots/forbid-in-is-correct.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2952402969, "forbid-in-is-correct.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var foo = () => {
|
||||
var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports);
|
||||
return D;
|
||||
};
|
||||
function test() {
|
||||
foo();
|
||||
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
|
||||
};
|
||||
8
integration/snapshots/forbid-in-is-correct.js
Normal file
8
integration/snapshots/forbid-in-is-correct.js
Normal file
@@ -0,0 +1,8 @@
|
||||
var foo = () => {
|
||||
var D = (i, r) => () => (r || i((r = {exports: {} }).exports, r), r.exports);
|
||||
return D;
|
||||
};
|
||||
export function test() {
|
||||
foo();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2277846108, "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
|
||||
};
|
||||
@@ -1,26 +1,4 @@
|
||||
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
|
||||
};
|
||||
export function test() {
|
||||
console.assert(globalThis === globalThis);
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
21
integration/snapshots/lodash-regexp.debug.js
Normal file
21
integration/snapshots/lodash-regexp.debug.js
Normal file
@@ -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);
|
||||
}
|
||||
|
||||
41
integration/snapshots/lodash-regexp.hmr.debug.js
Normal file
41
integration/snapshots/lodash-regexp.hmr.debug.js
Normal file
@@ -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
|
||||
};
|
||||
41
integration/snapshots/lodash-regexp.hmr.js
Normal file
41
integration/snapshots/lodash-regexp.hmr.js
Normal file
@@ -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 $cbd4e379 from "http://localhost:8080/node_modules/lodash/lodash.js";
|
||||
var { shuffle} = require($cbd4e379);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(1678450382, "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
|
||||
};
|
||||
21
integration/snapshots/lodash-regexp.js
Normal file
21
integration/snapshots/lodash-regexp.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import {
|
||||
__require as require
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import * as $cbd4e379 from "http://localhost:8080/node_modules/lodash/lodash.js";
|
||||
var { shuffle} = require($cbd4e379);
|
||||
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);
|
||||
}
|
||||
|
||||
22
integration/snapshots/multiple-imports.debug.js
Normal file
22
integration/snapshots/multiple-imports.debug.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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, JSXFrag = require(JSXClassic).Fragment;
|
||||
|
||||
var { default: React} = require($bbcd215f);
|
||||
var { default: React2} = require($bbcd215f);
|
||||
const bacon = React;
|
||||
|
||||
const bacon2 = jsx(JSXFrag, {
|
||||
children: ["hello"]
|
||||
}, undefined, true, undefined, 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);
|
||||
}
|
||||
43
integration/snapshots/multiple-imports.hmr.debug.js
Normal file
43
integration/snapshots/multiple-imports.hmr.debug.js
Normal file
@@ -0,0 +1,43 @@
|
||||
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, JSXFrag = require(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, undefined, 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
|
||||
};
|
||||
43
integration/snapshots/multiple-imports.hmr.js
Normal file
43
integration/snapshots/multiple-imports.hmr.js
Normal file
@@ -0,0 +1,43 @@
|
||||
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 $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var JSXClassic = require($2ed51059);
|
||||
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
|
||||
|
||||
var { default: React} = require($2ed51059);
|
||||
var { default: React2} = require($2ed51059);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(1572769260, "multiple-imports.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
const bacon = React;
|
||||
const bacon2 = jsx(JSXFrag, {
|
||||
children: ["hello"]
|
||||
}, undefined, true, undefined, 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
|
||||
};
|
||||
22
integration/snapshots/multiple-imports.js
Normal file
22
integration/snapshots/multiple-imports.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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 $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var JSXClassic = require($2ed51059);
|
||||
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
|
||||
|
||||
var { default: React} = require($2ed51059);
|
||||
var { default: React2} = require($2ed51059);
|
||||
const bacon = React;
|
||||
|
||||
const bacon2 = jsx(JSXFrag, {
|
||||
children: ["hello"]
|
||||
}, undefined, true, undefined, 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);
|
||||
}
|
||||
17
integration/snapshots/package-json-exports/index.debug.js
Normal file
17
integration/snapshots/package-json-exports/index.debug.js
Normal file
@@ -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 async function test() {
|
||||
console.assert(InexactRoot.target === "browser");
|
||||
|
||||
console.assert(InexactFile.target === "browser");
|
||||
console.assert(ExactFile.target === "browser");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
async 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
|
||||
};
|
||||
37
integration/snapshots/package-json-exports/index.hmr.js
Normal file
37
integration/snapshots/package-json-exports/index.hmr.js
Normal file
@@ -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 $cc5b5b4d from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js";
|
||||
var InexactRoot = require($cc5b5b4d);
|
||||
import * as $3a1d0f08 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js";
|
||||
var InexactFile = require($3a1d0f08);
|
||||
import * as $6b803e42 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
|
||||
var ExactFile = require($6b803e42);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(3722745821, "package-json-exports/index.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
async 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
|
||||
};
|
||||
17
integration/snapshots/package-json-exports/index.js
Normal file
17
integration/snapshots/package-json-exports/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
__require as require
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import * as $cc5b5b4d from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js";
|
||||
var InexactRoot = require($cc5b5b4d);
|
||||
import * as $3a1d0f08 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js";
|
||||
var InexactFile = require($3a1d0f08);
|
||||
import * as $6b803e42 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
|
||||
var ExactFile = require($6b803e42);
|
||||
export async function test() {
|
||||
console.assert(InexactRoot.target === "browser");
|
||||
|
||||
console.assert(InexactFile.target === "browser");
|
||||
console.assert(ExactFile.target === "browser");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
28
integration/snapshots/spread_with_key.debug.tsx
Normal file
28
integration/snapshots/spread_with_key.debug.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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, jsxEl = require(JSXClassic).createElement;
|
||||
|
||||
var { default: React} = require($bbcd215f);
|
||||
export function SpreadWithTheKey({
|
||||
className
|
||||
}) {
|
||||
const rest = {};
|
||||
|
||||
return jsxEl("div", {
|
||||
className,
|
||||
...rest,
|
||||
onClick: () => console.log("click"),
|
||||
key: "spread-with-the-key"
|
||||
}, "Rendered component containing warning");
|
||||
}
|
||||
|
||||
export function test() {
|
||||
console.assert(React.isValidElement(jsx(SpreadWithTheKey, {
|
||||
className: "foo"
|
||||
}, undefined, true, undefined, this)));
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
51
integration/snapshots/spread_with_key.hmr.debug.tsx
Normal file
51
integration/snapshots/spread_with_key.hmr.debug.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
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, jsxEl = require(JSXClassic).createElement;
|
||||
|
||||
var { default: React} = require($bbcd215f);
|
||||
Bun.activate(true);
|
||||
|
||||
var hmr = new HMR(2717584935, "spread_with_key.tsx"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
function SpreadWithTheKey({
|
||||
className
|
||||
}) {
|
||||
const rest = {};
|
||||
return jsxEl("div", {
|
||||
className,
|
||||
...rest,
|
||||
onClick: () => console.log("click"),
|
||||
key: "spread-with-the-key"
|
||||
}, "Rendered component containing warning");
|
||||
}
|
||||
function test() {
|
||||
console.assert(React.isValidElement(jsx(SpreadWithTheKey, {
|
||||
className: "foo"
|
||||
}, undefined, true, undefined, this)));
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
SpreadWithTheKey: () => SpreadWithTheKey,
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_SpreadWithTheKey = hmr.exports.SpreadWithTheKey, $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_SpreadWithTheKey = exports.SpreadWithTheKey;
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_SpreadWithTheKey as SpreadWithTheKey,
|
||||
$$hmr_test as test
|
||||
};
|
||||
51
integration/snapshots/spread_with_key.hmr.tsx
Normal file
51
integration/snapshots/spread_with_key.hmr.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
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 $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var JSXClassic = require($2ed51059);
|
||||
var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement;
|
||||
|
||||
var { default: React} = require($2ed51059);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(263168651, "spread_with_key.tsx"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
function SpreadWithTheKey({
|
||||
className
|
||||
}) {
|
||||
const rest = {};
|
||||
return jsxEl("div", {
|
||||
className,
|
||||
...rest,
|
||||
onClick: () => console.log("click"),
|
||||
key: "spread-with-the-key"
|
||||
}, "Rendered component containing warning");
|
||||
}
|
||||
function test() {
|
||||
console.assert(React.isValidElement(jsx(SpreadWithTheKey, {
|
||||
className: "foo"
|
||||
}, undefined, true, undefined, this)));
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
SpreadWithTheKey: () => SpreadWithTheKey,
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_SpreadWithTheKey = hmr.exports.SpreadWithTheKey, $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_SpreadWithTheKey = exports.SpreadWithTheKey;
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_SpreadWithTheKey as SpreadWithTheKey,
|
||||
$$hmr_test as test
|
||||
};
|
||||
28
integration/snapshots/spread_with_key.tsx
Normal file
28
integration/snapshots/spread_with_key.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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 $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var JSXClassic = require($2ed51059);
|
||||
var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement;
|
||||
|
||||
var { default: React} = require($2ed51059);
|
||||
export function SpreadWithTheKey({
|
||||
className
|
||||
}) {
|
||||
const rest = {};
|
||||
|
||||
return jsxEl("div", {
|
||||
className,
|
||||
...rest,
|
||||
onClick: () => console.log("click"),
|
||||
key: "spread-with-the-key"
|
||||
}, "Rendered component containing warning");
|
||||
}
|
||||
|
||||
export function test() {
|
||||
console.assert(React.isValidElement(jsx(SpreadWithTheKey, {
|
||||
className: "foo"
|
||||
}, undefined, true, undefined, this)));
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
34
integration/snapshots/string-escapes.debug.js
Normal file
34
integration/snapshots/string-escapes.debug.js
Normal file
@@ -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);
|
||||
}
|
||||
57
integration/snapshots/string-escapes.hmr.debug.js
Normal file
57
integration/snapshots/string-escapes.hmr.debug.js
Normal file
@@ -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
|
||||
};
|
||||
57
integration/snapshots/string-escapes.hmr.js
Normal file
57
integration/snapshots/string-escapes.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2657253006, "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
|
||||
};
|
||||
34
integration/snapshots/string-escapes.js
Normal file
34
integration/snapshots/string-escapes.js
Normal file
@@ -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);
|
||||
}
|
||||
67
integration/snapshots/styled-components-output.hmr.js
Normal file
67
integration/snapshots/styled-components-output.hmr.js
Normal file
@@ -0,0 +1,67 @@
|
||||
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";
|
||||
var jsx = require(JSX).jsxDEV, fileName = "styled-components-output.js";
|
||||
|
||||
import * as $3b6c9f54 from "http://localhost:8080/node_modules/styled-components/dist/styled-components.esm.js";
|
||||
var { default: styled} = require($3b6c9f54);
|
||||
import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
|
||||
var { default: React} = require($bbcd215f);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(2972367994, "styled-components-output.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
const ErrorScreenRoot = styled.div`
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
background-color: #0b2988;
|
||||
color: #fff;
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
line-height: 1.5em;
|
||||
|
||||
& > p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
}
|
||||
`;
|
||||
function test() {
|
||||
console.assert(React.isValidElement(jsx(ErrorScreenRoot, {}, undefined, true, {
|
||||
fileName,
|
||||
lineNumber: 698
|
||||
}, this)));
|
||||
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
|
||||
};
|
||||
57
integration/snapshots/styledcomponents-output.debug.js
Normal file
57
integration/snapshots/styledcomponents-output.debug.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import {
|
||||
__require as require
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
|
||||
var jsx = require(JSX).jsxDEV;
|
||||
|
||||
import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
|
||||
var { default: styled} = require($d4051a2e);
|
||||
import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
|
||||
var { default: React} = require($bbcd215f);
|
||||
import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
|
||||
var { default: ReactDOM} = require($5b3cea55);
|
||||
const ErrorScreenRoot = styled.div`
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
background-color: #0b2988;
|
||||
color: #fff;
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
line-height: 1.5em;
|
||||
|
||||
& > p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
}
|
||||
`;
|
||||
|
||||
export function test() {
|
||||
const reactEl = document.createElement("div");
|
||||
document.body.appendChild(reactEl);
|
||||
ReactDOM.render(jsx(ErrorScreenRoot, {
|
||||
id: "error-el",
|
||||
children: ["The react child should have this text"]
|
||||
}, undefined, true, undefined, this), reactEl);
|
||||
const style = document.querySelector("style[data-styled]");
|
||||
console.assert(style, "style tag should exist");
|
||||
console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints");
|
||||
console.assert(document.querySelector("#error-el").textContent === "The react child should have this text");
|
||||
ReactDOM.unmountComponentAtNode(reactEl);
|
||||
reactEl.remove();
|
||||
style.remove();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
78
integration/snapshots/styledcomponents-output.hmr.debug.js
Normal file
78
integration/snapshots/styledcomponents-output.hmr.debug.js
Normal file
@@ -0,0 +1,78 @@
|
||||
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";
|
||||
var jsx = require(JSX).jsxDEV;
|
||||
|
||||
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:8080/node_modules/react/index.js";
|
||||
var { default: React} = require($bbcd215f);
|
||||
import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
|
||||
var { default: ReactDOM} = require($5b3cea55);
|
||||
Bun.activate(true);
|
||||
|
||||
var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
const ErrorScreenRoot = styled.div`
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
background-color: #0b2988;
|
||||
color: #fff;
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
line-height: 1.5em;
|
||||
|
||||
& > p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
}
|
||||
`;
|
||||
function test() {
|
||||
const reactEl = document.createElement("div");
|
||||
document.body.appendChild(reactEl);
|
||||
ReactDOM.render(jsx(ErrorScreenRoot, {
|
||||
id: "error-el",
|
||||
children: ["The react child should have this text"]
|
||||
}, undefined, true, undefined, this), reactEl);
|
||||
const style = document.querySelector("style[data-styled]");
|
||||
console.assert(style, "style tag should exist");
|
||||
console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints");
|
||||
console.assert(document.querySelector("#error-el").textContent === "The react child should have this text");
|
||||
ReactDOM.unmountComponentAtNode(reactEl);
|
||||
reactEl.remove();
|
||||
style.remove();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_test as test
|
||||
};
|
||||
78
integration/snapshots/styledcomponents-output.hmr.js
Normal file
78
integration/snapshots/styledcomponents-output.hmr.js
Normal file
@@ -0,0 +1,78 @@
|
||||
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";
|
||||
var jsx = require(JSX).jsxDEV;
|
||||
|
||||
import * as $ab83b9cf from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
|
||||
var { default: styled} = require($ab83b9cf);
|
||||
import * as $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var { default: React} = require($2ed51059);
|
||||
import * as $a259fa9b from "http://localhost:8080/node_modules/react-dom/index.js";
|
||||
var { default: ReactDOM} = require($a259fa9b);
|
||||
Bun.activate(false);
|
||||
|
||||
var hmr = new HMR(2744898121, "styledcomponents-output.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
const ErrorScreenRoot = styled.div`
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
background-color: #0b2988;
|
||||
color: #fff;
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
line-height: 1.5em;
|
||||
|
||||
& > p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
}
|
||||
`;
|
||||
function test() {
|
||||
const reactEl = document.createElement("div");
|
||||
document.body.appendChild(reactEl);
|
||||
ReactDOM.render(jsx(ErrorScreenRoot, {
|
||||
id: "error-el",
|
||||
children: ["The react child should have this text"]
|
||||
}, undefined, true, undefined, this), reactEl);
|
||||
const style = document.querySelector("style[data-styled]");
|
||||
console.assert(style, "style tag should exist");
|
||||
console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints");
|
||||
console.assert(document.querySelector("#error-el").textContent === "The react child should have this text");
|
||||
ReactDOM.unmountComponentAtNode(reactEl);
|
||||
reactEl.remove();
|
||||
style.remove();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
hmr.exportAll({
|
||||
test: () => test
|
||||
});
|
||||
})();
|
||||
var $$hmr_test = hmr.exports.test;
|
||||
hmr._update = function(exports) {
|
||||
$$hmr_test = exports.test;
|
||||
};
|
||||
|
||||
export {
|
||||
$$hmr_test as test
|
||||
};
|
||||
57
integration/snapshots/styledcomponents-output.js
Normal file
57
integration/snapshots/styledcomponents-output.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import {
|
||||
__require as require
|
||||
} from "http://localhost:8080/__runtime.js";
|
||||
import * as JSX from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
|
||||
var jsx = require(JSX).jsxDEV;
|
||||
|
||||
import * as $ab83b9cf from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
|
||||
var { default: styled} = require($ab83b9cf);
|
||||
import * as $2ed51059 from "http://localhost:8080/node_modules/react/index.js";
|
||||
var { default: React} = require($2ed51059);
|
||||
import * as $a259fa9b from "http://localhost:8080/node_modules/react-dom/index.js";
|
||||
var { default: ReactDOM} = require($a259fa9b);
|
||||
const ErrorScreenRoot = styled.div`
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
background-color: #0b2988;
|
||||
color: #fff;
|
||||
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
|
||||
sans-serif;
|
||||
line-height: 1.5em;
|
||||
|
||||
& > p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
}
|
||||
`;
|
||||
|
||||
export function test() {
|
||||
const reactEl = document.createElement("div");
|
||||
document.body.appendChild(reactEl);
|
||||
ReactDOM.render(jsx(ErrorScreenRoot, {
|
||||
id: "error-el",
|
||||
children: ["The react child should have this text"]
|
||||
}, undefined, true, undefined, this), reactEl);
|
||||
const style = document.querySelector("style[data-styled]");
|
||||
console.assert(style, "style tag should exist");
|
||||
console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints");
|
||||
console.assert(document.querySelector("#error-el").textContent === "The react child should have this text");
|
||||
ReactDOM.unmountComponentAtNode(reactEl);
|
||||
reactEl.remove();
|
||||
style.remove();
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
3
integration/snapshots/ts-fallback-rewrite-works.debug.js
Normal file
3
integration/snapshots/ts-fallback-rewrite-works.debug.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export function test() {
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
25
integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js
Normal file
25
integration/snapshots/ts-fallback-rewrite-works.hmr.debug.js
Normal file
@@ -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
|
||||
};
|
||||
25
integration/snapshots/ts-fallback-rewrite-works.hmr.js
Normal file
25
integration/snapshots/ts-fallback-rewrite-works.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(631080924, "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
|
||||
};
|
||||
3
integration/snapshots/ts-fallback-rewrite-works.js
Normal file
3
integration/snapshots/ts-fallback-rewrite-works.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export function test() {
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function test() {
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
25
integration/snapshots/tsx-fallback-rewrite-works.hmr.js
Normal file
25
integration/snapshots/tsx-fallback-rewrite-works.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2958250497, "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
|
||||
};
|
||||
3
integration/snapshots/tsx-fallback-rewrite-works.js
Normal file
3
integration/snapshots/tsx-fallback-rewrite-works.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export function test() {
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
35
integration/snapshots/type-only-imports.hmr.debug.ts
Normal file
35
integration/snapshots/type-only-imports.hmr.debug.ts
Normal file
@@ -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
|
||||
};
|
||||
35
integration/snapshots/type-only-imports.hmr.ts
Normal file
35
integration/snapshots/type-only-imports.hmr.ts
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2365801153, "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
|
||||
};
|
||||
@@ -1,35 +1,7 @@
|
||||
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
|
||||
};
|
||||
export const baconator = true;
|
||||
export const SilentSymbolCollisionsAreOkayInTypeScript = true;
|
||||
export function test() {
|
||||
console.assert(SilentSymbolCollisionsAreOkayInTypeScript);
|
||||
console.assert(baconator);
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
7
integration/snapshots/unicode-identifiers.debug.js
Normal file
7
integration/snapshots/unicode-identifiers.debug.js
Normal file
@@ -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);
|
||||
}
|
||||
30
integration/snapshots/unicode-identifiers.hmr.debug.js
Normal file
30
integration/snapshots/unicode-identifiers.hmr.debug.js
Normal file
@@ -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
|
||||
};
|
||||
30
integration/snapshots/unicode-identifiers.hmr.js
Normal file
30
integration/snapshots/unicode-identifiers.hmr.js
Normal file
@@ -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(false);
|
||||
|
||||
var hmr = new HMR(2975064322, "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
|
||||
};
|
||||
7
integration/snapshots/unicode-identifiers.js
Normal file
7
integration/snapshots/unicode-identifiers.js
Normal file
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
var was_called = false;
|
||||
function thisShouldBeCalled() {
|
||||
was_called = true;
|
||||
}
|
||||
thisShouldBeCalled();
|
||||
export function test() {
|
||||
if (!was_called)
|
||||
throw new Error("Expected thisShouldBeCalled to be called");
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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(635901064, "void-shouldnt-delete-call-expressions.js"), exports = hmr.exports;
|
||||
(hmr._load = function() {
|
||||
var was_called = false;
|
||||
function thisShouldBeCalled() {
|
||||
was_called = true;
|
||||
}
|
||||
thisShouldBeCalled();
|
||||
function test() {
|
||||
if (!was_called)
|
||||
throw new Error("Expected thisShouldBeCalled to be called");
|
||||
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
|
||||
};
|
||||
28
integration/snippets/array-args-with-default-values.js
Normal file
28
integration/snippets/array-args-with-default-values.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var lines;
|
||||
const data = () =>
|
||||
lines.map(([a = null, b = null, c = null, d = null]) => ({
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
}));
|
||||
|
||||
export function test() {
|
||||
let ran = false;
|
||||
lines = [
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
[undefined, undefined, undefined, undefined],
|
||||
];
|
||||
|
||||
for (let foo of data()) {
|
||||
console.assert(foo.a === null);
|
||||
console.assert(foo.b === null);
|
||||
console.assert(foo.c === null);
|
||||
console.assert(foo.d === null);
|
||||
ran = true;
|
||||
}
|
||||
console.assert(ran);
|
||||
testDone(import.meta.url);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user