-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Assetgraph propagate symbols #4861
Merged
Merged
Conversation
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 pull request has been linked to and will mark 1 task as "Done" when merged:
|
mischnic
force-pushed
the
assetgraph-propagate-symbols-fast
branch
from
July 8, 2020 17:37
244f060
to
85c7a04
Compare
mischnic
commented
Jul 8, 2020
mischnic
commented
Jul 8, 2020
mischnic
changed the title
Assetgraph propagate symbols fast
Assetgraph propagate symbols
Jul 8, 2020
mischnic
force-pushed
the
assetgraph-propagate-symbols-fast
branch
2 times, most recently
from
July 11, 2020 15:52
1618e41
to
8047131
Compare
Use symbols: '*' instead of cleared symbols
mischnic
force-pushed
the
assetgraph-propagate-symbols-fast
branch
from
July 13, 2020 21:46
8047131
to
2ddbc64
Compare
5 tasks
mischnic
force-pushed
the
assetgraph-propagate-symbols-fast
branch
from
August 7, 2020 14:17
8ebd1e5
to
17fa612
Compare
wbinnssmith
approved these changes
Nov 18, 2020
gorakong
pushed a commit
that referenced
this pull request
Nov 18, 2020
Co-authored-by: Will Binns-Smith <[email protected]>
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.
↪️ Pull Request
Supersedes #4841
Closes #4565
Closes T-675
After building the asset graph, propagate symbols in two passes (up & down). This is faster than doing it while building the asset graph because the bookkeeping (many nodes are visited multiple times) brings too much overhead.
Use
asset.usedSymbols
information to:Use
dependency.usedSymbols
information to:sideEffects: ["*.css"]
is usually required to get any CSS at all).We now need to check for missing exports in the AssetGraphBuilder, because when importing a missing symbol would mean that no symbols in that subgraph are actually used and the subgraph is removed entirely. The packager wouldn't be able to differentiate between "asset is missing because an import was wrong" and "asset is missing because it was unused & excluded". So resolving symbols essentially happens not when replacing the used import but when resolving the dependency, this might cause problems for TS's "phantom" imports? This could be alleviated by not adding a symbol to the dependency when hoisting if it's not actually referenced in the asset.
Follow up tasks:
✔️ PR Todo
html.js
this.propagateSymbols()
incremental (only update when assets changed)Complete Benchmark
Benchmark (while determining which strategy to use)
Times in ms
ak-editor$ parcel2 build . --no-minify --no-source-maps
baseline: not incremental:
baseline: without the topological ordering:
current: incremental, cold cache:
main
runtime
current: incremental, no change
main
"up" is slow because of getIncomingDependencies