Page MenuHomeElementl

[dagit] Split the bundle
ClosedPublic

Authored by dish on Wed, Apr 14, 2:19 PM.

Details

Summary

Stacked on https://dagster.phacility.com/D7418.

A handful of changes to enable (and take the first couple steps in) bundle splitting.

  • Use __webpack_public_path__ to set a path prefix dynamically. This will be used for all dynamically loaded bundles. The file that sets this value must be the first import in the entry file. I added comments to that effect.
  • Change how we set the path prefix in the DOM. This approach is more in line with how we're handling other preloaded values.
  • Split InstanceRoot and WorkspaceRoot as a first step. This ensures that the approach works, and is a reasonable first place to split the bundle anyway.
Test Plan

yarn build-for-python.

  • Run Dagit with no path prefix, navigate to pages throughout Dagit. Verify that everything loads, and that bundle chunks load properly.
  • Run Dagit with path prefix, verify same.

Run Dagit for development, verify same.

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Apr 14, 2:37 PM
Harbormaster failed remote builds in B28805: Diff 35356!

Test failed, not sure why. Try again.

Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Apr 14, 5:34 PM
Harbormaster failed remote builds in B28821: Diff 35377!

Lengthen App.test timeout. Not sure what's up with that.

Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Apr 14, 7:01 PM
Harbormaster failed remote builds in B28837: Diff 35394!

Try a different approach to avoid test timeout.

Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Apr 14, 8:00 PM
Harbormaster failed remote builds in B28850: Diff 35408!
Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Apr 14, 8:21 PM
Harbormaster failed remote builds in B28853: Diff 35411!
dish requested review of this revision.Wed, Apr 14, 9:34 PM
prha added inline comments.
js_modules/dagit/packages/core/src/app/FeatureFlagsRoot.tsx
41

For code splitting, this has to be exported as default?

Can we add a comment here that this is for code-splitting and to be loaded with React.lazy?

js_modules/dagit/packages/core/src/instance/InstanceRoot.tsx
33

same

js_modules/dagit/packages/core/src/workspace/WorkspaceRoot.tsx
123

same

This revision is now accepted and ready to land.Thu, Apr 15, 4:16 AM
This revision was automatically updated to reflect the committed changes.