Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since not everyone might use JSON Forms and all the features
sci-react-uihas, I've made this PR as a proposal to allow code splitting of modules, that way, one can import only what they need and reduce bundle size (similar to the approachmaterial-uihas, for instance).We also reduce the number of dependencies, as that way, one doesn't end up importing JSON-Forms or KeycloakJS if they're only using navbars.
Also, as a follow-up to #160, I've used default exports for
material-icons, as that only imports the icons we're actually using.I've also rewritten package exports to use a slightly more modern (supported since Node v12) structure, where instead of using
mainandmodule, we can assign several separate exports and entry points, which makes tree-shaking and code splitting easier.However, this is still backwards compatible, and anyone using barrel imports from
@diamondlightsource/sci-react-uidirectly should not be affected, nor should anyone building this package on Node <v12 (they shouldn't, but it still works)This requires #160 as it builds on top of those changes.