Skip to content
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

Merged

Conversation

kleisauke
Copy link
Collaborator

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.

`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');
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@kripken kripken left a 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.

@kleisauke
Copy link
Collaborator Author

Sorry for the delay, I just added a note to the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants