-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the amount of code shipped to users' browsers by ensuring we're only loading code that's actually required and making smart use of our dependencies and support for tree shaking where available. This change reduces the size of the vendor JS bundle by ~1MB (~50%) by making two relatively small changes: - disable the import of carbon-components-react for the custom UI extensions which are not currently supported (~500KB savings) - switch the `react-syntax-highlighter` from using Prism to highlight.js, also ensure we're only loading the language definition required As a result of the switch to loading the highlight.js language definition from an esmodule, we also need to update the jest config for unit tests to exclude the react-syntax-highlighter package from some of its processing to avoid errors related to imports used outside of modules. Another benefit of switching from Prism to highlight.js is more consistent syntax highlighting, particularly for the YAML which we care about. Strings are consistently highlighted regardless of whether they're quoted or not.
- Loading branch information
1 parent
c9d96a0
commit 72047c2
Showing
5 changed files
with
17 additions
and
10 deletions.
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
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
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