refactor(accounts-controller)!: revert wildcard export #5300
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.
Explanation
Using a wildcard export in the root
index.ts
of a package is, regrettably, not an ideal practice. This file is very useful because it gives us a way to understand everything that a package publicly exports at a glance.In using a wildcard export, however, we lose this visibility. Because all symbols marked with
export
will automatically become exports of the package, it is possible to introduce a new export without even knowing about it. We also lose the ability to export a symbol purely for internal purposes, which is useful for tests.As it relates to the change being reverted, because of the introduction of this wildcard export, new exports have been introduced which will now need to be reverted in a new major version, namely
AllowedActions
andAllowedEvents
. This is non-ideal; we should not have to introduce major versions if we do not need to, because they are disruptive.Elsewhere it was noted that needing to add an export manually to this list is a small pain point especially if other subdirectories also use
index.ts
. I would argue that not knowing about exports (regardless of at which level exports occur) creates more trouble in the long run. That is, the small pain point is a intentional feature and not a bug :)References
See #5224.
Changelog
(None; no functional changes)
Checklist