Jarred Sumner
74db7809eb
Most of the code & API changes necessary for supporting Relay (GraphQL)
2021-09-29 23:28:54 -07:00
Jarred Sumner
2f8be4f13f
()
2021-09-27 21:05:20 -07:00
Jarred Sumner
37ffe4501c
Ignore leading invalid unicode characters in response bodies in Response.text()
2021-09-27 21:03:00 -07:00
Jarred Sumner
13f6297312
Access object properties from macros
2021-09-27 21:01:34 -07:00
Jarred Sumner
f9dfa226a5
Fix bug in string eql check that was never used before
2021-09-27 20:53:57 -07:00
Jarred Sumner
0da19a25cf
u16 isn't big enough
2021-09-27 16:28:04 -07:00
Jarred Sumner
3b92a867e2
Pass User-Agent in fetch() by default (but allow overriding)
2021-09-27 16:09:17 -07:00
Jarred Sumner
1ada4a2c67
Fix bug in URL parser
2021-09-27 16:08:57 -07:00
Jarred Sumner
97ad21dc68
Fix typo in error
2021-09-27 16:08:34 -07:00
Jarred Sumner
62d51f7d2e
Set macros enabled
2021-09-27 01:33:53 -07:00
Jarred Sumner
4f9558dd71
Bundling ignores macros
2021-09-27 01:33:23 -07:00
Jarred Sumner
adf22db8b6
bounds checking
2021-09-27 00:40:44 -07:00
Jarred Sumner
eb3473125c
Allow nested arrays
2021-09-26 23:04:07 -07:00
Jarred Sumner
b3894994c0
Fix getting object properties
2021-09-26 21:21:51 -07:00
Jarred Sumner
e1306be4be
Update Bun.readFileAsBytes and Bun.readFile to also accept an array of filepaths to join
...
For example:
```
Bun.readFileAsString([Bun.main, "../pages/hi.tsx"]);
```
2021-09-26 20:06:10 -07:00
Jarred Sumner
002d46d0c4
Add JSArrayIterator, don't call JSC::Options after JSC already loaded once (that causes a crash)
2021-09-26 20:04:26 -07:00
Jarred Sumner
018ba2c83b
Most of macro implementation
2021-09-26 20:03:49 -07:00
Jarred Sumner
66ed7c1f30
Basic macro impl
2021-09-26 00:14:15 -07:00
Jarred Sumner
ff8393ce32
WIP
2021-09-25 14:16:05 -07:00
Jarred Sumner
8b209aecf9
fix incorrect comment
2021-09-25 14:16:05 -07:00
Jarred Sumner
a0fb04d6e5
Fix bug with resolving "browser" field in package.json
...
It was resolving from the parent directory of the result instead of the browser scope.
2021-09-25 02:05:01 -07:00
Jarred Sumner
44497ef384
Fix lexing bug with the \f form feed character (used in Emotion & Styled Components)
2021-09-25 02:03:59 -07:00
Jarred Sumner
5fb38b92d9
Fix crashing edgecase when both JSX automatic and JSX classic imports are necessary and unbundled
2021-09-25 02:03:27 -07:00
Jarred Sumner
66b29654c0
Fix visiting bug when using JSX with a spread prop and a key and one of the props is an anonymous function
...
More specifically, Bun shouldn't be visiting the same properties more than once. That was the cause.
2021-09-25 00:33:45 -07:00
Jarred Sumner
940570af59
skeleton code
2021-09-24 16:41:45 -07:00
Jarred Sumner
bdfb5a91b1
macro
2021-09-24 15:33:02 -07:00
Jarred Sumner
29b986684d
🍧
2021-09-24 15:28:30 -07:00
Jarred Sumner
e48a0877ef
@setCold
2021-09-24 15:26:55 -07:00
Jarred Sumner
22837d69b7
Remove cache_files since it's not used and causes slower Bun compilation times
2021-09-24 15:23:55 -07:00
Jarred Sumner
78cd857bf6
Add link to webpack doc
2021-09-23 22:09:41 -07:00
Jarred Sumner
2a1235c9db
🏃
2021-09-23 22:01:43 -07:00
Jarred Sumner
f78f4854a4
Handle more edgecases in our CJS2ESM conversion code
2021-09-23 21:45:15 -07:00
Jarred Sumner
ff01dfa03d
When bundling JSON, only use JSON.parse when the input is ASCII.
...
We don't want to add an extra pass over the input to convert it to UTF16. And JS engines storing strings as UTF-16 is more expensive anyway, so the runtime win here probably isn't as big (though open to evidence to the contrary!)
2021-09-23 21:43:37 -07:00
Jarred Sumner
638b204d1e
Add __exportValue and __exportDefault to runtime
2021-09-23 19:20:33 -07:00
Jarred Sumner
58e88c4aed
When bundling, parse the JSON to verify correctness, but print it as a string for better runtime performance
2021-09-23 19:20:07 -07:00
Jarred Sumner
8433919342
Safer export default transform for bundled code
2021-09-23 19:19:32 -07:00
Jarred Sumner
8150b9aeba
Fix crash when loading JS fails really quickly
2021-09-23 17:40:25 -07:00
Jarred Sumner
01601fc8a7
Globally define require() so that UMD modules which check for the existence of require() to determine if it's CommonJS use the CommonJS code path instead of the globalThis code path
2021-09-23 17:36:49 -07:00
Jarred Sumner
7b24042d5f
Embed regeneratorRuntime so that things which expect it to be a global still work
2021-09-23 17:36:04 -07:00
Jarred Sumner
2177dda242
Fix bug when multiple-levels of nested exports when bundled have a boolean .default value
2021-09-23 17:34:54 -07:00
Jarred Sumner
0585c86390
Support alwaysBundle for workspace packages
2021-09-23 17:33:20 -07:00
Jarred Sumner
528caab47c
Add a pointer to the parent package_json for a directory. This reduces pointer chasing
2021-09-23 17:33:01 -07:00
Jarred Sumner
b150df34e0
Fix another simplification bug
2021-09-23 17:32:39 -07:00
Jarred Sumner
da80c3b309
Fix a simplification bug
2021-09-23 17:32:29 -07:00
Jarred Sumner
e8804bd80f
Use the package_json hash for matching bundled modules instead of searching strings (should improve perf a little)
2021-09-23 17:31:59 -07:00
Jarred Sumner
57ed3c89a2
Add "bun": { "alwaysBundle": ["packageName"] }, to package.json
...
This is for monorepos that symlink directories into node_modules. For example, if you have a design system in your monorepo, you probably want to always bundle that.
2021-09-23 00:17:06 -07:00
Jarred Sumner
1a284a1c94
Extremely minor perf improvements
2021-09-22 18:12:18 -07:00
Jarred Sumner
f12dd51c00
Update query_string_map.zig
2021-09-22 16:19:25 -07:00
Jarred Sumner
e00c1e99d6
Allow URLs containing absolute filepaths in imports if they match specific file extensions
...
This is to support ../../ imports
Allowlisting to specific file extensions prevents common webserver security vulnerabilities like reading /etc/passwd
2021-09-22 16:19:16 -07:00
Jarred Sumner
39323b46ba
Fix edgecase with whether to wrap arrow expressions in parentheses when printing
2021-09-22 16:13:44 -07:00