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

feat(ses): Opt out of namespace boxes #2380

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Conversation

kriskowal
Copy link
Member

Refs: #400

Description

To reduce mismatched behavior between SES and XS, this change adds an option (to be removed at the next major version) that changes the compartment import method such that it returns a promise for an exports namespace instead of a promise for a box containing the imports namespace. This opts-in to the same thenable behavior as dynamic import in the language.

Security Considerations

With this option, we must be weary of thenable modules, as we must be for thenable modules across the rest of the JavaScript ecosystem.

Scaling Considerations

None.

Documentation Considerations

This option will necessarily appear in all portable code examples on hardenedjs.org once it is available.

Testing Considerations

Tests have been adjusted to take advantage of the new option, except legacy tests which remain to test the behavior without the option enabled.

Compatibility Considerations

This is a backward compatible change. Namespace boxes are hereafter deprecated and we hope to remove this option on the next major release, making the new behavior mandatory or at least opt-out.

Upgrade Considerations

None.

@kriskowal kriskowal requested a review from erights July 25, 2024 00:16
Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM!

@kriskowal kriskowal merged commit a772166 into master Jul 25, 2024
17 checks passed
@kriskowal kriskowal deleted the kriskowal-compartment-parity branch July 25, 2024 04:53
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.

2 participants