-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Deprecate export of module handlers via EXPORTED_RUNTIME_METHODS
#17955
Deprecate export of module handlers via EXPORTED_RUNTIME_METHODS
#17955
Conversation
`print` / `printErr` are handlers that can be overridden by the user on the incoming module (just like `onAbort`) and not runtime elements that can be exported. Deprecate the export of `print` / `printErr` via `EXPORTED_RUNTIME_METHODS` in favor of `out` / `err`.
src/modules.js
Outdated
@@ -311,6 +311,10 @@ function addMissingLibraryStubs() { | |||
function exportRuntime() { | |||
const EXPORTED_RUNTIME_METHODS_SET = new Set(EXPORTED_RUNTIME_METHODS); | |||
|
|||
const legacyRuntimeElements = new Map(); | |||
legacyRuntimeElements.set('print', 'out'); | |||
legacyRuntimeElements.set('printErr', 'err'); |
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.
Does JS not have a literal syntax for this?
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.
TIL, https://stackoverflow.com/a/35962243. See commit f6c2f80.
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.
Please add a note to the changelog.
Sorry for the delay, I just added a note to the changelog. |
print
/printErr
are handlers that can be overridden by the user on the incoming module (just likeonAbort
) and not runtime elements that can be exported. Deprecate the export ofprint
/printErr
viaEXPORTED_RUNTIME_METHODS
in favor ofout
/err
.