Skip to content

Commit

Permalink
Experimental bundler integration (#8180)
Browse files Browse the repository at this point in the history
* add ref edges whenever there are bundle edges

* add edge from bundlegroups to bundles wip

* * Get inline bundles in bundle group in HTML packager
* Traverse each bundle instead of iterating each outbound node
* Add edge between root and bundle

* use and follow reference edges again

* set env whenever we create bundles

* Check to add parallel edges from all paths to an asset from a bundle

* Always register referenced bundles before pruning when building bundle manifest

* Add test for referenced roots in bundle manifest

* Add reused sibling bundles to asyncBundleRootGraph

* Add test case for asset that has both an async and sync import

*stop at isolated bundles

*initialize entry bundles with no ancestors

*accept shared bundles extracted from workers

* Remove unused async bundles if needed

* Scope-hositing with new bundler: allow less duplication

* Consider sibling availability before removing from ancestorAssets

* Remove reachableBundles

* Consider sibling availability before removing from ancestorAssets

* Consider assets in siblings before duplicating

* Don't consider any of parent's async bundles as sibling

* remove eager bundle reuse and related lending code

* implement parallel request limits

* create all shared bundles first then remove later

* Alter tests with mode production and correct assets with logic for splittable bundles

* Skip unused dependencies in experimental bundler

* Implement getBundleFromBundleRoot

* Only add dependencies to CSS module JS, not CSS

* Handle multiple assets on dependencies in reachability

* ScopeHoistingPackager: Handle different wrapped ancestries in wrapping dfs

* move reachable root creation earlier to prevent unnecessary async bundle

* replace reachableroots with syncAssetsRequired and skip sync deps for entries later on

* Revert "replace reachableroots with syncAssetsRequired and skip sync deps for entries later on"

* Implement cleanup for internalized deps from entrys

* skip assets for reachable if isolated or inline fix invariant

* skip assets for reachable if isolated or inline fix invariant

* Use bundleGroup instead of bundle root for determining needsStableName

* remove asset references for deleted bundles + minor fixes

* Filter out bundleroots from reacable if they are subgraphs, consider isIsolated

* Add bundle.mainEntryAsset

* ExperimentalBundler: merge bundleBehavior and needsStableName

* don't remove bundles depended on by url

* don't flatted bundle to bundlegroup edges

* point config to default bundler, create type change bundle regardless them clean based on bundlegroups, add referencing bundle to stack when creating bundles instead of only parent or bundlegroup, add merge and delete bundles to clean all structures

* extract shared bundles from inline bundles

* Internalize all async bundle before placing assets into bundles, add internalized assets to share bundles from their source bundles

* add assert bundles to test

* Reverse merge asset insertion order to maintain dep order for css, remove addassetonexit, instead do upward dfs to determine bundlegroups for assets

* Forked tests which rely on size calculation for shared bundles which is different across bundles and rename bundles steps without numbers

* Addedge support to toposort, use edges to differentiate parallel and async relationships in bundleroot, share assets between paralllel dep bundleroots

* Add support for multiple targets by bundling per entries per target

* parallel request limits + test

* Dont allow multiple bundles of entry type in entry bundlegroupsr

* Add parallel step for running integration tests with experimental bundler (#8245)

Co-authored-by: Gora Kong <gora.kong1@gmail.com>
Co-authored-by: Will Binns-Smith <wbinnssmith@atlassian.com>
Co-authored-by: Eric Eldredge <lettertwo@gmail.com>
Co-authored-by: thebriando <bdo@atlassian.com>
Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Co-authored-by: Devon Govett <devongovett@gmail.com>
Co-authored-by: Gora Kong <15333808+gorakong@users.noreply.github.com>
  • Loading branch information
8 people committed Jun 30, 2022
1 parent aa83272 commit 1beacec
Show file tree
Hide file tree
Showing 28 changed files with 1,324 additions and 477 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -91,12 +91,48 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Integration tests (${{matrix.os}}, node ${{matrix.node}})
path: '**/junit-*.xml'
path: "**/junit-*.xml"

experimental_bundler_integration_tests:
name: Experimental Bundler Integration tests (${{matrix.os}}, Node ${{matrix.node}})
strategy:
matrix:
node: [14, 16]
os: [ubuntu-latest, macos-latest, windows-latest]
# These tend to be quite flakey, so one failed instance shouldn't stop
# others from potentially succeeding
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
if: ${{matrix.os == 'ubuntu-latest'}}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn test:integration-ci
env:
PARCEL_TEST_EXPERIMENTAL_BUNDLER: 1
# Similar to
# https://github.com/marketplace/actions/publish-unit-test-results#use-with-matrix-strategy
- name: Upload JUnit results
if: always()
uses: actions/upload-artifact@v2
with:
name: Exprimental Bundler Integration tests (${{matrix.os}}, node ${{matrix.node}})
path: "**/junit-*.xml"

test_report:
name: Test report
runs-on: ubuntu-latest
needs: [unit_tests, integration_tests]
needs:
[unit_tests, integration_tests, experimental_bundler_integration_tests]
if: always()
steps:
- name: Create test report
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -27,7 +27,7 @@ yarn install
yarn build-native
```

If you want, you can create a temporary example for debugging in the folder `packages/examples`. You can start by copying the `simple` example and try to reproduce the bug. It has everything set up for working on local changes and you can run `yarn build` to build the project. If you're re-using another example or creating one from scratch, make sure to use the `--no-cache` flag for `parcel build` to see your local changes reflected. *Please don't commit this example.*
If you want, you can create a temporary example for debugging in the folder `packages/examples`. You can start by copying the `simple` example and try to reproduce the bug. It has everything set up for working on local changes and you can run `yarn build` to build the project. If you're re-using another example or creating one from scratch, make sure to use the `--no-cache` flag for `parcel build` to see your local changes reflected. _Please don't commit this example._

After you've figured out where the issue originated from and found a fix, try to add a test case or ask for help on how to proceed if the use case is more complex.

Expand Down

0 comments on commit 1beacec

Please sign in to comment.