-
-
Notifications
You must be signed in to change notification settings - Fork 681
BREAKING CHANGE: ESM, JS bindings, triple equals and general cleanup #2157
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
Merged
Changes from 103 commits
Commits
Show all changes
184 commits
Select commit
Hold shift + click to select a range
7dab337
work
dcodeIO cba554c
Merge branch 'main' into esm
dcodeIO 2194988
remove unused dependencies
dcodeIO 83b659f
various fixes
dcodeIO 14eedb6
update allocator and loader tests
dcodeIO ff9e30b
integrate diagnostics into build
dcodeIO df44d47
update binaryen to latest
dcodeIO 7715882
clean up scripts
dcodeIO 7b89619
restructure
dcodeIO a0b5077
restructure
dcodeIO 10699dd
restructure
dcodeIO 0fba4d3
update instructions
dcodeIO 1bee659
update instructions
dcodeIO 4492b4a
remove generated files from source control
dcodeIO d048c1e
readit
dcodeIO d3a1274
remove old binaryen tests
dcodeIO c6557b0
remove rogue file
dcodeIO 281ae4d
remove old path test
dcodeIO 592f503
refactor browser test
dcodeIO 4f932b2
readthat
dcodeIO 4faba35
update options test
dcodeIO 479aff4
update dts generation
dcodeIO 84ccac4
link asc to as defs
dcodeIO a3d4531
put it all together
dcodeIO 78dbabd
work around ambient <-> esm name clashing
dcodeIO 28e7791
share common types namespace
dcodeIO 9165068
simplify
dcodeIO 4076286
update transform
dcodeIO 3f9223d
remove unnecessary line
dcodeIO 1b51772
fix
dcodeIO 35a1e12
fix
dcodeIO 02dc4a1
restructure
dcodeIO a4d1958
fix
dcodeIO 4bb1814
fix
dcodeIO cdf107f
readme
dcodeIO ce914fc
update dependencies
dcodeIO 8c59d2b
make it work in browsers
dcodeIO 15c5044
remove unnecessary check
dcodeIO fae90f8
use relative paths
dcodeIO b57b1d8
simplify building / watching
dcodeIO 41c2bb1
readmes
dcodeIO 8ef9ce2
readme
dcodeIO 0aeafb4
sdk is just an html file now
dcodeIO f6a5385
remove old sdk
dcodeIO 9b5aeb7
remove outdated lib/webpack
dcodeIO f6e70d7
tidy more
dcodeIO d867b23
fix?
dcodeIO c47d4a5
less
dcodeIO 2c4ad81
more
dcodeIO fa6150b
now?
dcodeIO a5610fa
moremore
dcodeIO d3d3096
package as well
dcodeIO 69cbdbc
dot
dcodeIO d6112aa
move CODE_OF_CONDUCT to org
dcodeIO 790a1c0
more
dcodeIO 90df2b3
nah
dcodeIO 193baaa
use native source map support
dcodeIO 39951d6
also in tests
dcodeIO 6620f77
proxy binaryen
dcodeIO 2598e71
fix
dcodeIO e4e239e
cli as well
dcodeIO cd66585
readme
dcodeIO da61ab0
readme
dcodeIO c36dafb
make asc.main async
dcodeIO 3845795
split bootstrap tests
dcodeIO e09ec02
sync api and readme
dcodeIO 1db68bd
split test as well?
dcodeIO 0a9a1a2
update compileString, accept options object in main
dcodeIO b54aefe
propagate fs.promises
dcodeIO 9877cb7
unify
dcodeIO d46bee7
wait for pending operations to settle
dcodeIO 8fa2845
?
dcodeIO fca4666
fix
dcodeIO cbbd064
tidy ci
dcodeIO 0446963
things
dcodeIO 502d1b9
fix
dcodeIO 395f4a9
drawing boxes
dcodeIO 3d071a9
update dts
dcodeIO b96f9d3
remove dead rc tests
dcodeIO d039865
refactor
dcodeIO b84e976
Merge branch 'main' into esm
dcodeIO 8b1ae12
update binaryen and fixtures
dcodeIO 75e76f4
Merge branch 'main' into esm
dcodeIO 0a93d92
exclude 'debug.log'
dcodeIO 25ec2cd
Merge branch 'main' into esm
dcodeIO eac6b31
more
dcodeIO 416d734
drop webidl and asm.js
dcodeIO c2f5f32
support ESM and CJS transforms
dcodeIO eda668e
support async transforms
dcodeIO 0492055
update definitions
dcodeIO 5d0b109
can't even test this snap stuff
dcodeIO 272461a
still no idea
dcodeIO 40679b5
update binaryen
dcodeIO 1c40822
fix fs/url shim
dcodeIO 34b7c55
test more of transform
dcodeIO 3c73d15
Update cli/index.d.ts
dcodeIO 2b2ae1d
Update cli/index.d.ts
dcodeIO 14c25d9
more
dcodeIO 0ba9dcf
Update cli/index.js
dcodeIO 850ec4b
more
dcodeIO 046d8e7
more
dcodeIO 4fd9050
manually sync esbuild version
dcodeIO 43ecbe8
invert asc stdout/stderr default to memory stream
dcodeIO abc1d81
more
dcodeIO 67f4b84
delete snap, probably not good ux anyway
dcodeIO d08c3dd
defer building definitions on first run
dcodeIO 94c4f37
use promise defer
dcodeIO 31702c6
undo reporter flag
dcodeIO 02972f8
move parse to examples
dcodeIO 5b3f24a
Merge branch 'main' into esm
dcodeIO 5c383f1
enable incremental builds when watching
dcodeIO e39d9ae
harden transforms
dcodeIO d46eb68
make sure it's super duper
dcodeIO 0eba569
did this even exist by then
dcodeIO 2f1eb73
modernize
dcodeIO 5706912
delete old packages tests
dcodeIO 3900ef8
remove ascMain, add new tests
dcodeIO 090ce5c
fix
dcodeIO 096a77c
fix
dcodeIO 88b31bf
fix, remove --extension
dcodeIO 2b2aee8
Merge branch 'main' into esm
dcodeIO 7fb896a
update fixture
dcodeIO 6a711e7
fix?
dcodeIO 34b1212
nuke more options
dcodeIO 81ef128
update Binaryen
dcodeIO 40dceea
rename --measure to --stats
dcodeIO 8182779
fix unknown option warning
dcodeIO 541a1cd
fix
dcodeIO 9dfcd7c
Merge branch 'main' into esm
dcodeIO 15c47ea
use incremental in cli build as well
dcodeIO c839986
better
dcodeIO 1d3c4be
Update cli/README.md
dcodeIO 0ff0820
Update cli/index.js
dcodeIO 2b6428f
Update tests/allocators/default/package.json
dcodeIO e17a6ca
Update cli/index.d.ts
dcodeIO 9468996
Merge branch 'main' into esm
dcodeIO 556f0df
sync fixtures
dcodeIO df054ba
more measure -> stats
dcodeIO 83e0632
explicitStart -> exportStart
dcodeIO 931495d
lint
dcodeIO 3a83bb0
enable various features
dcodeIO 23b5f9e
move enabled feature tests
dcodeIO a69cffd
update CI
dcodeIO 9da0fdd
keep simd behind a flag for now
dcodeIO e2ac2d3
add timing util
dcodeIO 75328a9
tackle === vs ==
dcodeIO 1722afa
unify
dcodeIO 337c826
update binaryen
dcodeIO 47f4eb4
add total time to stats
dcodeIO e25ca01
comment
dcodeIO cc1bd11
same
dcodeIO 05913bf
account for usize ptr, refactor
dcodeIO 1dadb87
minor
dcodeIO 634e414
preserve side effects in 'constant' type checks
dcodeIO c6590de
remove invalid comment
dcodeIO 9cc6962
initial bindings
dcodeIO 772df6f
fixes
dcodeIO 0787128
bootstrap fixes
dcodeIO 61da567
fix
dcodeIO bc7973e
disable class/namespace loader tests
dcodeIO af1b4fa
rename untouched/optimized to debug/release
dcodeIO 2c2ec07
improve typings
dcodeIO fb6bc87
some Deno compatibility for asc
dcodeIO 74f744c
update Binaryen
dcodeIO 3186d99
?
dcodeIO 07609a7
??
dcodeIO 2033e2d
disable on windows?
dcodeIO 63ed838
add a comment
dcodeIO 270a01b
move loader docs to its readme (is now deprecated)
dcodeIO bd22829
move development instructions to readme
dcodeIO b1870ce
add experimental `module` specifier
dcodeIO b17cefb
update Binaryen (no fixture changes)
dcodeIO b163bd5
update asinit
dcodeIO a223638
don't need a top-level index.js anymore
dcodeIO b9120d1
update link to docs
dcodeIO cc45b9e
export types
dcodeIO 628bd8e
simplify
dcodeIO d7a4404
simplify
dcodeIO 5bfaa99
make console/crypto/process usable with bindings
dcodeIO 45f4ee8
reorganize some bindings
dcodeIO 4721a2c
update dependencies
dcodeIO 70e9b88
Merge branch 'main' into esm
dcodeIO ef60e80
bindings fixes
dcodeIO ded520a
update features
dcodeIO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| dist/ | ||
| docs/ | ||
| lib/binaryen.js | ||
| lib/parse/index.js | ||
| out/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| bin/* text eol=lf | ||
| dist/* binary | ||
| scripts/*.sh eol=lf | ||
| lib/binaryen.js binary | ||
| tests/compiler/std/string-encoding.ts eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,12 +20,13 @@ jobs: | |
| else | ||
| printf "\nOK: Distributions files have not been modified.\n"; | ||
| fi | ||
| test: | ||
| name: "Compiler (Linux, node ${{ matrix.node_version }})" | ||
| runs-on: ubuntu-latest | ||
| compiler: | ||
| name: "Compiler (${{ matrix.os }}, node ${{ matrix.node_version }})" | ||
| runs-on: ${{ matrix.os }}-latest | ||
| needs: check | ||
| strategy: | ||
| matrix: | ||
| os: ["ubuntu", "macos", "windows"] | ||
| node_version: ["current", "lts_latest"] | ||
| steps: | ||
| - uses: actions/[email protected] | ||
|
|
@@ -34,86 +35,33 @@ jobs: | |
| node-version: ${{ matrix.node_version }} | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Check sources | ||
| run: npm run check | ||
| - name: Test sources | ||
| run: npm test | ||
| - name: Build distribution files | ||
| run: npm run build | ||
| - name: Update entry file | ||
| run: npm run prepare-ci | ||
| - name: Test distribution | ||
| run: npm test | ||
| - name: Test browser build | ||
| run: node tests/browser-asc | ||
| test-windows: | ||
| name: "Compiler (Windows, node current)" | ||
| runs-on: windows-latest | ||
| needs: check | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: dcodeIO/setup-node-nvm@master | ||
| with: | ||
| node-version: current | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Test sources | ||
| run: npm test | ||
| - name: Build distribution files | ||
| run: npm run build | ||
| - name: Update entry file | ||
| run: npm run prepare-ci | ||
| - name: Test distribution | ||
| run: npm test | ||
| - name: Test browser build | ||
| run: node tests/browser-asc | ||
| test-macos: | ||
| name: "Compiler (MacOS, node current)" | ||
| runs-on: macos-latest | ||
| needs: check | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: dcodeIO/setup-node-nvm@master | ||
| with: | ||
| node-version: current | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Test sources | ||
| run: npm test | ||
| - name: Build distribution files | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Update entry file | ||
| run: npm run prepare-ci | ||
| - name: Test distribution | ||
| - name: Check | ||
| run: npm run check | ||
| - name: Test | ||
| run: npm test | ||
| - name: Test browser build | ||
| run: node tests/browser-asc | ||
| test-bootstrap: | ||
| name: "Compiler (Bootstrap)" | ||
| bootstrap: | ||
| name: "Bootstrap (${{ matrix.target }})" | ||
| runs-on: ubuntu-latest | ||
| needs: check | ||
| strategy: | ||
| matrix: | ||
| target: ["untouched", "optimized"] | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: dcodeIO/setup-node-nvm@master | ||
| with: | ||
| node-version: current | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Bootstrap the compiler | ||
| run: npm run bootstrap | ||
| - name: Run compiler tests (untouched-bootstrap) | ||
| run: npm run test:compiler -- --wasm out/assemblyscript.untouched-bootstrap.wasm | ||
| - name: Run compiler tests (optimized-bootstrap) | ||
| run: npm run test:compiler -- --wasm out/assemblyscript.optimized-bootstrap.wasm | ||
| test-features: | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Bootstrap | ||
| run: npm run bootstrap:${{ matrix.target }} | ||
| - name: Test | ||
| run: npm run test:compiler -- --wasm out/assemblyscript.${{ matrix.target }}-bootstrap.wasm | ||
| features: | ||
| name: "Features" | ||
| runs-on: ubuntu-latest | ||
| needs: check | ||
|
|
@@ -125,14 +73,14 @@ jobs: | |
| node-version: 18.0.0-v8-canary20211115037fd7ae8d | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Test experimental features | ||
| env: | ||
| ASC_FEATURES: threads,reference-types,bigint-integration,gc | ||
| run: | | ||
| npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/threads std-wasi/process std-wasi/crypto | ||
| test-runtimes: | ||
| runtimes: | ||
| name: "Runtimes" | ||
| runs-on: ubuntu-latest | ||
| needs: check | ||
|
|
@@ -143,8 +91,8 @@ jobs: | |
| node-version: current | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Test default allocator | ||
| run: | | ||
| cd tests/allocators/default | ||
|
|
@@ -157,7 +105,7 @@ jobs: | |
| npm run build | ||
| cd .. | ||
| npm test stub | ||
| test-loader: | ||
| loader: | ||
| name: "Loader" | ||
| runs-on: ubuntu-latest | ||
| needs: check | ||
|
|
@@ -168,8 +116,8 @@ jobs: | |
| node-version: current | ||
| - name: Install dependencies | ||
| run: npm ci --no-audit | ||
| - name: Clean distribution files | ||
| run: npm run clean | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Test the loader | ||
| run: | | ||
| cd lib/loader | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| npm-debug.* | ||
| dist/ | ||
| docs/ | ||
| node_modules/ | ||
| *debug.* | ||
| dist/ | ||
| out/ | ||
| raw/ | ||
| .history | ||
| *.backup | ||
| .vscode | ||
| .idea | ||
| cli/index.generated.js | ||
| src/diagnosticMessages.generated.ts |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import childProcess from "child_process"; | ||
|
|
||
| const [ nodePath, thisPath, ...args ] = process.argv; | ||
| const nodeArgs = process.execArgv; | ||
|
|
||
| const hasSourceMaps = nodeArgs.includes("--enable-source-maps"); | ||
| const hasCustomArgs = args.includes("--"); | ||
|
|
||
| if (!hasSourceMaps || hasCustomArgs) { | ||
| if (!hasSourceMaps) { | ||
| nodeArgs.push("--enable-source-maps"); | ||
| } | ||
| if (hasCustomArgs) { | ||
| const index = args.indexOf("--"); | ||
dcodeIO marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| nodeArgs.push(...args.slice(index + 1)); | ||
| args.length = index; | ||
| } | ||
| childProcess.spawnSync( | ||
MaxGraey marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| nodePath, | ||
| [...nodeArgs, thisPath, ...args], | ||
| { stdio: "inherit" } | ||
| ); | ||
| } else { | ||
| const asc = await import("../dist/asc.js"); | ||
| const { error } = await asc.main(process.argv.slice(2), { | ||
| stdout: process.stdout, | ||
| stderr: process.stderr | ||
| }); | ||
| if (error) process.exitCode = 1; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why support the option if it is always enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, it's not AS-specific, we just always want Node to have it enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, previously was using an npm package for source map support, but recent Node has this option which works better. In particular, when crashing, this produces a proper trace instead of a lot of gibberish.