Skip to content

Commit f55c835

Browse files
committed
feat: use --block-scoping for Hermes instead of Babel transform
1 parent 8b5337b commit f55c835

4 files changed

Lines changed: 2 additions & 19 deletions

File tree

bin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { glob as globImplementation } from '../src/glob.cjs'
1919
const DEFAULT_PATTERNS = [`**/?(*.)+(spec|test).?([cm])[jt]s?(x)`] // do not trust magic dirs by default
2020
const bundleOpts = { pure: true, bundle: true, esbuild: true, ts: 'auto' }
2121
const bareboneOpts = { ...bundleOpts, barebone: true }
22-
const hermesA = ['-Og', '-Xmicrotask-queue']
22+
const hermesA = ['-Og', '-Xmicrotask-queue', '--block-scoping']
2323
const denoA = ['run', '--allow-all'] // also will set DENO_COMPAT=1 env flag below
2424
const denoT = ['test', '--allow-all']
2525
const nodeTS = process.features.typescript ? 'auto' : 'flag'

bundler/bundle.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const init = async ({ platform, jest, flow, target, jestConfig, outdir, e
143143
compact: false,
144144
babelrc: false,
145145
configFile: false,
146-
plugins: ['@babel/plugin-transform-block-scoping', '@babel/plugin-transform-classes'],
146+
plugins: ['@babel/plugin-transform-classes'],
147147
})
148148
return result.code
149149
})
@@ -154,7 +154,6 @@ const hermesSupported = {
154154
arrow: false,
155155
class: false, // we get a safeguard check this way that it's not used
156156
'async-generator': false,
157-
'const-and-let': false, // have to explicitly set for esbuild to not emit that in helpers, also to get a safeguard check
158157
'for-await': false,
159158
}
160159

bundler/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
},
7474
"optionalDependencies": {
7575
"@babel/core": "^7.0.0",
76-
"@babel/plugin-transform-block-scoping": "^7.0.0",
7776
"@babel/plugin-transform-classes": "^7.0.0",
7877
"flow-remove-types": "^2.242.0"
7978
},

pnpm-lock.yaml

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)