aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-26 16:54:22 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-26 16:54:36 -0700
commit664ccec7d33cc94ba829f35fc7ef8ca7794095cc (patch)
tree8213b2ee01afa39c9bb1c9d26aa5cae6d13d0cdc /src
parent1a558ef7538a19545e5934dfc99edf86ec436892 (diff)
downloadbun-664ccec7d33cc94ba829f35fc7ef8ca7794095cc.tar.gz
bun-664ccec7d33cc94ba829f35fc7ef8ca7794095cc.tar.zst
bun-664ccec7d33cc94ba829f35fc7ef8ca7794095cc.zip
Disable concurrent transpiler in macros
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/javascript.zig2
-rw-r--r--src/bun.js/module_loader.zig3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index a049f4263..d8043ca44 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -751,6 +751,7 @@ pub const VirtualMachine = struct {
this.macro_mode = true;
this.event_loop = &this.macro_event_loop;
Analytics.Features.macros = true;
+ this.transpiler_store.enabled = false;
}
pub fn disableMacroMode(this: *VirtualMachine) void {
@@ -758,6 +759,7 @@ pub const VirtualMachine = struct {
this.bundler.resolver.caches.fs.use_alternate_source_cache = false;
this.macro_mode = false;
this.event_loop = &this.regular_event_loop;
+ this.transpiler_store.enabled = true;
}
pub fn getAPIGlobals() []js.JSClassRef {
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index 245b2ffa1..0e4cb5ba2 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -178,6 +178,7 @@ pub const RuntimeTranspilerStore = struct {
generation_number: std.atomic.Atomic(u32) = std.atomic.Atomic(u32).init(0),
store: TranspilerJob.Store,
+ enabled: bool = true,
pub fn init(allocator: std.mem.Allocator) RuntimeTranspilerStore {
return RuntimeTranspilerStore{
@@ -2035,7 +2036,7 @@ pub const ModuleLoader = struct {
if (allow_promise and loader.isJavaScriptLike() and
// Plugins make this complicated,
// TODO: allow running concurrently when no onLoad handlers match a plugin.
- jsc_vm.plugin_runner == null)
+ jsc_vm.plugin_runner == null and jsc_vm.transpiler_store.enabled)
{
if (!strings.eqlLong(specifier, jsc_vm.main, true)) {
return jsc_vm.transpiler_store.transpile(