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
Emscripten: Add EmscriptenModule interface type, make Module an instance of it. #36094
Conversation
👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. If you have any questions or comments about me, you can ping |
@wffurr Thank you for submitting this PR! 🔔 @zakki @periklis - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
// By default Emscripten emits a single global Module. Users setting -s | ||
// MODULARIZE=1 -s EXPORT_NAME=MyMod should declare their own types, e.g. | ||
// declare var MyMod: EmscriptenModule; | ||
declare var Module: EmscriptenModule; |
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.
Maybe we could omit this one, so that every person defines the correct module name. If one uses the default settings, Emscripten will indeed emit Module
, but otherwise this will "pollute" the global types. What do you think?
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.
The default Emscripten configuration uses the global Module name. It's unfortunate that it's so generic but I don't know of any specific conflicts with it. @periklis in the linked issue (#24791) claims that the MODULARIZE option with other names is not much used.
Of the two use cases I have encountered at work where we have just imported this typings definition, one uses Module and the other sets a name with MODULARIZE.
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.
I'd prefer to keep the annotation in order to make using the typings definition simple for Emscripten users with the default set up.
After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience! |
Congratulations on your first DefinitelyTyped contribution! |
I just published |
Thank you Benjamin,
…On Thu, Jun 27, 2019, 5:53 PM Benjamin Lichtman ***@***.***> wrote:
Congratulations on your first DefinitelyTyped contribution!
Thank you for being a part of the community!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36094?email_source=notifications&email_token=AAD62UT2EZO5CQC4VM2DTDLP4UZEHA5CNFSM4HWYRJGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYYPMOQ#issuecomment-506525242>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD62UWJIOVPSKYCPW5LFPTP4UZEHANCNFSM4HWYRJGA>
.
|
Fixes #24791. I plan to use this when sending code to Emscripten for generating TypeScript typings from embind bindings.
Note that this changed some type names:
Module.WebAssemblyImports
→Emscripten.WebAssemblyImports
Module.WebAssemblyExports
→Emscripten.WebAssemblyExports
This was required because
Module
is now an instance of theEmscriptenModule
interface, and can't host type aliases.@cpitclaudel @periklis please review and comment if this meets your needs.
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
.