aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-24 09:36:34 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-24 09:36:34 -0700
commitec66b1819a2fd218c62c069d29aab7eed482f6e9 (patch)
tree81381b1aa464e81b118bf64951b58cd21eedf83e
parent0a18da2d05a7c17fc63aa05b5db9bdcc3e303be8 (diff)
downloadbun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.tar.gz
bun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.tar.zst
bun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.zip
WIP
-rw-r--r--README.md30
-rw-r--r--src/js_parser.zig18
2 files changed, 37 insertions, 11 deletions
diff --git a/README.md b/README.md
index 9d1c86dde..be159c23a 100644
--- a/README.md
+++ b/README.md
@@ -59,6 +59,30 @@ There's a number of reasons for this:
#### Different constraints enable performance improvements
-If bundler means "merge N source files into 1 or few source file(s)", esdev is most definitely not a bundler. Unlike most bundlers today, esdev deliberately outputs
-
-If bundler means "turn my development code into something a browser can run",
+If bundler means "merge N source files into 1 or few source file(s)", esdev is most definitely not a bundler. Unlike most bundlers today, esdev deliberately outputs
+
+If bundler means "turn my development code into something a browser can run",
+
+### Compatibility Table
+
+Key:
+
+- ✅ means "compatible"
+- ❌ means "not supported, and no plans to change that"
+- ⌛ means "in-progress"
+- 🗓️ means "planned" or "eventually but work has not started"
+- ❓ means "unknown"
+
+| Feature | esbuild | esdev |
+| ---------------------------------- | ------- | ----- |
+| Minification | ✅ | ❌ |
+| JSX (transform) | ✅ | ⌛ |
+| TypeScript (transform) | ✅ | ⌛ |
+| Hot Module Reloading | ❌[1] | ⌛ |
+| React Fast Refresh | ❌[1] | ⌛ |
+| Tree Shaking | ✅ | ⌛ |
+| Incremental builds | ✅ | ⌛ |
+| Support older browsers | ✅ | ❌[2] |
+| Plugins | ✅ | ⌛[3] |
+| AST Plugins | ❌ | ❌[4] |
+| Filesystem Cache API (for plugins) | ❓ | 🗓️[4] |
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 03988d0f1..e7692c76f 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -13,6 +13,7 @@ usingnamespace js_ast.G;
const ImportKind = importRecord.ImportKind;
const BindingNodeIndex = js_ast.BindingNodeIndex;
+
const StmtNodeIndex = js_ast.StmtNodeIndex;
const ExprNodeIndex = js_ast.ExprNodeIndex;
const ExprNodeList = js_ast.ExprNodeList;
@@ -997,14 +998,15 @@ const P = struct {
std.debug.panic("Internal error", .{});
}
- // for name, member := range scope.parent.members {
- // // Don't copy down the optional function expression name. Re-declaring
- // // the name of a function expression is allowed.
- // kind := p.symbols[member.Ref.InnerIndex].Kind
- // if kind != js_ast.SymbolHoistedFunction {
- // scope.Members[name] = member
- // }
- // }
+ var iter = scope.parent.?.members.iterator();
+ while (iter.next()) |entry| {
+ // // Don't copy down the optional function expression name. Re-declaring
+ // // the name of a function expression is allowed.
+ const adjacent_symbols = p.symbols.items[entry.value.ref.inner_index];
+ if (adjacent_symbols.kind != .hoisted_function) {
+ try scope.members.put(entry.key, entry.value);
+ }
+ }
}
return i;