feat: upgrade to typescript v6 & binaryen v129#8
Open
BlobMaster41 wants to merge 4 commits intov0.29from
Open
Conversation
Bump development dependencies (ESLint toolchain, TypeScript, esbuild, @typescript-eslint and related packages) and regenerate the lockfile. Remove the custom "indent" rule from eslint.config.js to simplify formatting/style enforcement. Apply small, related adjustments in tsconfig-base.json, std/assembly/util/number.ts and tests/allocators/runner.js.
Adapt project to updated Binaryen / wasm IR and toolchain behavior. Key changes: - Updated TypeScript glue for Binaryen: use bigint for i64/f64-bits literals, add MemoryOrder parameter to atomic ops and default to SeqCst, change AtomicFence signature, adjust string/table/memory segment APIs, and rename/fix several function signatures to match the new Binaryen runtime. - Modified module.ts to add new feature flags, expression ids, MemoryOrder enum, atomic helpers that pass the memory order, updated i64 literal construction to use BigInt, and added addTable helper handling addressType. - Pre-create default memory in compiler.ts so Binaryen helpers can resolve memory references earlier in compilation. - build-dts.js: drop side-effect-only imports when generating declaration bundles to avoid TS2882 with nodenext resolution. - package.json: relax/adjust tsc script flags for config and ignoreConfig to better fit the build/check workflows. - Updated many emitted .wat tests to reflect new codegen (reordered memory.size usage, local.set vs local.tee changes, br_table target canonicalization, stack handling and inlining/folding changes, etc.). These updates align the codebase with the newer Binaryen API and ensure correct declaration output and wasm code generation under the updated toolchain.
Multiple changes: - scripts/build-dts.js: Removed the previous drop-for-side-effect-only-imports logic and instead emit an explicit empty module stub for 'src/glue/js/index' to avoid TS2882 under TS >= 6 (nod e n e x t module resolution) while keeping the ambient declarations already emitted. - src/compiler.ts: Add a duplicate-function check for semantically named declarations that compares source and start position to distinguish recompilation from true duplicate implementations; emit DiagnosticCode.Duplicate_function_implementation and return unreachable on error. Also minor reordering of the local module variable. - src/glue/binaryen.d.ts: Introduce DataSegmentRef = Ref and update Binaryen memory segment APIs to use DataSegmentRef for segment parameters (get offset/length and copy functions). These changes fix TypeScript declaration generation issues, improve duplicate-implementation detection, and correct Binaryen typings for data segments.
Add a JS wrapper that patches the binaryen export to provide (low, high) i64 literal/const accessors on top of binaryen 129's BigInt-based C-ABI (with a sentinel to avoid double-patching). Update TypeScript declarations and glue to reflect the new low/high signatures, re-export the wrapped functions, and adjust Module usages to call the new APIs (including replacing inline BigInt packing and adding explicit <u8> casts for MemoryOrder in atomic ops). This preserves compatibility with AssemblyScript callers and the bootstrapped wasm host shim that expect the legacy split i64 convention.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adapt project to updated Binaryen / wasm IR and toolchain behavior. Key changes:
These updates align the codebase with the newer Binaryen API and ensure correct declaration output and wasm code generation under the updated toolchain.