HomeElementl

[dagit] Split app into packages

Description

[dagit] Split app into packages

Summary:
This diff divides the Dagit app into yarn workspaces with their own packages. This gives us flexibility to break Dagit source apart further, treating it more like a library.

The bulk of the diff is the movement of files from dagit/src to dagit/packages/core/src, and can be ignored.

The dagit directory now just contains a package.json that defines these two workspaces and a couple yarn scripts. The workspaces are:

  • @dagit/core, at dagit/packages/core
    • Exports a couple of root components (for now), contains 99.5% of Dagit source
    • Uses babel and tsc builds to produce js and d.ts output for consumption
    • Includes a couple of yarn scripts to start watchers, enabling HMR-enabled development of Dagit source while working on the Dagit app
  • @dagit/app, at dagit/packages/app
    • A thin CRA wrapper that just renders components from @dagit/core, for now. Assume this will become more complex.

Each package has its own ts and lint scripts.

I have also made some changes to dagit/Makefile.

For the most part, the dev and build workflow should remain the same as they are. You'll still run the same make commands to start the app in development mode or for a build. A major change here is that the start command (for dev) will now also kick off the watchers for @dagit/core, so that the app will build and update correctly while you develop it.

Test Plan:
Within both packages/core and packages/app, run yarn ts and yarn lint. Also run yarn download-schema and yarn generate-types within packages/core to verify that these work correctly.

Development:

  • Run make dev_webapp from js_modules/dagit. Verify that the app build starts and watches correctly, and that once everything is working, my changes to @dagit/core code correctly trigger rebuilds and HMR in the browser.
  • Run yarn build-for-python from js_modules/dagit. Verify that a full prod build is created and put in the correct python_modules destination.

The above is also verified with the current Buildkite config.

Reviewers: bengotow, max, dgibson, prha

Reviewed By: bengotow

Differential Revision: https://dagster.phacility.com/D7159

Details

Provenance
dishAuthored on Mar 29 2021, 2:21 PM
Reviewer
bengotow
Differential Revision
D7159: [dagit] Split app into packages
Parents
R1:00ea314a185c: [dagit] Move dagit/src -> dagit/packages/core/src
Branches
Unknown
Tags
Unknown