generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
9.0.0 #190
Closed
Closed
9.0.0 #190
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should note why this is breaking? Or is this breaking? I think we still use the same functionality.
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.
Here's the compare link for the package.json diff between these versions. The
exports
field and the dual type declaration files are added after we switch to@metamask/superstruct
.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.
Or wait would this dependency replacement not be a breaking change even if the dependency contains breaking changes?
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.
My intuition is that since
superstruct@^1.0.3
broke downstream packages of@metamask/utils
by preventing them from being imported into TypeScript projects (e.g.core/*
) that use theNodeNext
setting formoduleResolution
, the fixes introduced by@metamask/superstruct
should count as breaking changes.By that logic, it seems the type declaration files fix might also be a breaking change, since it fixes an issue that was breaking downstream packages, not just directly but also via nested dependencies.
Both of these might count as cases where a fix may need to be announced as a breaking change.
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.
Hmm.
superstruct
is definitely unusable in a project that usesmoduleResolution
ofnodenext
, and that means that@metamask/utils
is unusable too. So, upgrading this dependency makes@metamask/utils
usable again (i.e. it's a fix). So, are there cases where this upgrade would break other kinds of TypeScript projects that currently use@metamask/utils
? I don't believe the changes to the exports propagate to@metamask/utils
, so people would be able to import it the same way. But, for instance, are there any specific TS compiler settings that a project would no longer be able to use after this upgrade?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.
All good points! I'm finding that reverting the TypeScript version and
module
,moduleResolution
settings on the core v5.0 upgrade PR does cause breakage, but so far I'm mostly seeing errors related to themultiformats
dynamic import. I'll try out other compiler options combinations to see if any errors related to@metamask/utils
pop up.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.
It doesn't look like the switch to
@metamask/superstruct
causes any new restrictions for downstream packages. Since there are no breaking changes left, I'll close this PR and create a new minor release.