-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
change(web): remove support for es5 🏗️ #11881
Merged
Merged
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
afe25ed
change(web): remove support for es5
ermshiperete 877cd97
fix(common): add workaround for divergence of EventEmitter3 from node…
jahorton 2d9d847
fix(web): add dependency output
ermshiperete 918b7ab
Update web/build.sh
ermshiperete 9de6818
chore(web): output different build steps for keyboard-processor
ermshiperete 6e41fae
change(web): use different output directory for tests
ermshiperete 98691e5
change(web): improve casts
ermshiperete 852b8e8
chore(web): improve auto-test references to globals in #11881
jahorton 1945965
chore(web): apply suggestion
jahorton 5552fdd
chore(web): expose `util.ts` as separate sub-export
ermshiperete eb9205f
chore(web): fix build
ermshiperete 02170dd
chore(web): update common/web/types/src/main.ts
ermshiperete fd8ffb5
chore(web): don't deep import and remove sub-export of util
ermshiperete e42a895
fix(web): export consts
ermshiperete 1389d40
Merge branch 'master' into change/web/11878_remove-es5
ermshiperete 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 was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": "../", | ||
"outDir": "../build/tests/", | ||
"tsBuildInfoFile": "../build/tests/tsconfig.tsbuildinfo", | ||
"rootDir": "./" | ||
}, | ||
"include": [ "./dom/**/*.ts"], | ||
"exclude": [] | ||
} |
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.
Requiring this style of import for the utility methods prevents treeshaking from working as well as it could. Having to import the
Uni_IsSurrogate*
functions through a higher-level structure (the collectiveexport * as util
pattern) results in esbuild importing all functions exported from that structure.Tracking issue: evanw/esbuild#1420
This can be found within the debug build of web's app/browser when built:
Warning - long code block! (click to expand)
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.
If I instead import those functions directly from the original, defining source file...
Way less imported code this way - easily enough to account for a few KB in file-size difference even when minified.
Alternatively, exporting the two explicitly from
common/web/types/src/main.ts
outside of a "namespace" export would also do the job. Could be "in addition to" to keep the overall change set minimal, rather than removing it from theutil
namespace currently used by other consumers.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.
Alternatively... we could just leave the versions defined within
common/web/utils
in place, as they're not subject to the import pattern causing the issue.Alternatively-alternatively, we could expose the
util.js
file as its own... "sub-export"(?) fromcommon/web/types
. It's a pattern I'm comfortable implementing if we want to go that route. We'd then be able toimport { whatever } from '@keymanapp/common-types/utils'
or similar. (We can choose what we name that final path component.)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.
Implemented the alternative alternative. With that the size stays the same.