-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation to mention compatibility with ES2022 #2888
Conversation
What error did you receive? Just curious. esbuild does mention that they support es2022. |
./node_modules/.bin/ts-node cli/coda.ts execute documentation/samples/packs/hello_world/hello_world.ts Hello "Eric" --vm=false [16:16:58]
/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/insert-module-globals/index.js:114
var e = new SyntaxError(
^
SyntaxError: Unexpected token (511:13) while parsing /var/folders/kp/k5sf9p811dg_yxm73vqnd_sr0000gq/T/coda-packs-7530a212-3ad4-4067-b694-3cba08499be4yHNhln/esbuild-bundle.js while parsing file: /var/folders/kp/k5sf9p811dg_yxm73vqnd_sr0000gq/T/coda-packs-7530a212-3ad4-4067-b694-3cba08499be4yHNhln/esbuild-bundle.js
at DestroyableTransform.end [as _flush] (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/insert-module-globals/index.js:114:21)
at DestroyableTransform.prefinish (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_transform.js:138:10)
at DestroyableTransform.emit (node:events:513:28)
at DestroyableTransform.emit (node:domain:489:12)
at prefinish (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:619:14)
at finishMaybe (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:627:5)
at endWritable (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at DestroyableTransform.Writable.end (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at DestroyableTransform.onend (/Users/EricKoleda/code/packs-sdk/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:627:28) |
Thanks. I am also taking a look. |
Actually. I am not exactly sure if the es2022 bundle will run in isolated-vm. We are running into this error because browserify doesn't accept some es2022 syntax. Take a step back, we don't really need the target to be es2022 right? The goal is probably to allow monaco understand es2022 syntax (in the browser editor) but the bundle target (which is the binary that runs in isolated-vm) doesn't need to be es2022. |
From what I can tell, browserify uses the package |
I would suggest to stay on es2020 for the target for now. Let me take a quick look at monaco editor side.
Right. Browserify is one issue. I am more worried if isolated-vm supports the full ES2022 syntax. |
Yes, that is my understanding as well. Targeting ES2020 will I believe create shims for newer language features, which in theory could be a bit slower than using the native feature, but likely not enough to matter in practice. |
Update the overview page to mention support for ES2022 language features, now that the Packs runtime has been updated to run on Node 18.
I tried updating
compile.ts
to target ES2022 directly, but ran into some errors. This is fine though, as esbuild will just downlevel any newer features.