TypeScript Core - #8861
Conversation
|
TODO:
|
|
In general this looks pretty good to me, but not being a TypeScript person, I'm not the right reviewer here. Hopefully @ericvergnaud or @brendandahl or other people already cc'd on this issue have time and interest to review this. |
|
Hi @kripken @tlively @MaxGraey @ericvergnaud , wondering if you could give this a review and/or more feedback. Happy to answer any questions. I also have a stacked PR (#8881 is next, but there will be more) that depend on this, to break up #8826 into smaller parts as suggested. Is there continued group interest in moving forward with this? If there is some hesitancy maybe we can continue the discussion in #8656. Thanks! |
|
I do think it would be nice to move forward with a TS API, especially given how much LLMs love to write typescript. I'm in the same boat as @kripken where I don't really have the background to do a useful review, though. We'll talk with @brendandahl and try to come up with a way forward soon. Thanks for your work on this and your patience in the meantime! |
|
Given what's happened re TS over the past 2 years i.e. nothing, I believe the governance issue remains unsolved. |
brendandahl
left a comment
There was a problem hiding this comment.
Overall, looks pretty good. I'd like to get the typechecking test issue addressed though. Also, I may be missing something, but it also seems we're missing an end-to-end test that uses the result of npm compile in a TypeScript project. This doesn't need to be done in this PR (already huge), but would be good to add in the future.
The one thing that has changed, is the burden of maintaining this (due to LLMs). I think we should try out merging this PR and see how keeping it up to date goes. As Thomas mentioned, I don't think this will be too bad anymore since |
|
@brendandahl That sounds great, thanks! @ericvergnaud Your review of this code would also be appreciated, if you have interest. I think we are in a better place now than before. |
|
One other issue I noticed, after building locally I had a lot of extra untracked files. I'm guessing there's some gitignore that needs to be updated. |
|
@brendandahl Which files did you notice? I updated the root |
The first of several PRs in an attempt to break up #8826 into smaller parts. This PR sets up core typescript functionality and ports over only the top-level types, constants, and enums of the JS API.
Changes:
ts/folder with README.md, package.json, tsconfig.json, and other project filesCMakeLists.txt, exporting needed variables & methods (likeHEAP8) from Emscripten into the JS buildts/src/-pre.tsimports the Emscripten-builtBinaryenfunction, calls and awaits it, and exports that as an internal object calledBinaryenObj(AssemblyScript calls this objectbinaryenand exports that publicly).ts/src/**: the typescript library sits on top of the Emscripten artifact. it accesses the WASM bindings onBinaryenObjimported from-pre.ts.ts/src/binaryen.tsfor users, exporting all the parts of the public-facing API. Users use a namespace import instead of a default import:users will still use the same API (
binaryen.ExpressionRef,binaryen.i32,binaryen.Module, etc.)ts/tests/. hopefully this will take some of the weight off the python testsNon-Changes:
API Deprecations (see
ts/src/-deprecations.tsfor full list; will evolve with more PRs):binaryen.Features→binaryen.Feature)binaryen.Features, but there is a doc-comment@deprecatedwarning for intellisense support)Get started:
See
ts/package.json,ts/README.md, andts/docs/API-Overview.md(in this PR) for details.