-
Notifications
You must be signed in to change notification settings - Fork 2
BA-2680: switch to just-in-time compilation strategy #286
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
Changes from all commits
555b0e8
aa09452
e2b98de
88a5121
c8817a2
a6d4f72
1f3fea3
3819c7d
44100d3
2be5fd5
25263f7
991ded5
2ae758d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -88,51 +88,12 @@ pnpm build --filter=@baseapp-frontend/authentication | |||||||
|
|
||||||||
| ## Develop | ||||||||
|
|
||||||||
| Our development mode is designed to provide immediate feedback as you work on our monorepo apps and packages. In dev mode, each package automatically watches for changes in its source files, rebuilds itself using a custom build process, and synchronizes its output (bundled code, type declarations, etc.) to the consumer app. | ||||||||
|
|
||||||||
| This ensures that any changes you make are quickly reflected in the running application without the need to manually rebuild or restart servers. | ||||||||
|
|
||||||||
| ### What Happens in Dev Mode | ||||||||
|
|
||||||||
| Some of our packages—like `@baseapp-frontend/components` and `@baseapp-frontend/design-system`—have a multi-step build process. When you run: | ||||||||
| To develop all apps and packages, run the following command: | ||||||||
|
|
||||||||
| ```bash | ||||||||
| pnpm dev | ||||||||
| ``` | ||||||||
|
|
||||||||
| Each package in our monorepo enters a persistent watch mode. | ||||||||
|
|
||||||||
| For example, when running dev mode for `@baseapp-frontend/components`, you might see output similar to the following: | ||||||||
| ```bash | ||||||||
| [@baseapp-frontend/components] Waiting for other packages to start... # wait for other dependencies to be build | ||||||||
| [@baseapp-frontend/components] Starting build process... # start the build process | ||||||||
| [@baseapp-frontend/components] Running Relay Compiler... # since this package uses relay, run the relay compiler | ||||||||
| [@baseapp-frontend/components] Relay compilation completed. | ||||||||
| [@baseapp-frontend/components] Running Babel transpiling... # run babel step to transpile the code | ||||||||
| [@baseapp-frontend/components] Babel transpilation completed. | ||||||||
| [@baseapp-frontend/components] Running tsup bundling... # run tsup step to bunle the code | ||||||||
| [@baseapp-frontend/components] Running type declaration generation... # run tsc step to create type declarations | ||||||||
| [@baseapp-frontend/components] tsup Bundling completed. | ||||||||
| [@baseapp-frontend/components] Type declarations generated. | ||||||||
| [@baseapp-frontend/components] Copying DTS files... # merge the declaration files with the bundled files | ||||||||
| [@baseapp-frontend/components] DTS files copied. | ||||||||
| [@baseapp-frontend/components] Cleaning temporary files... # remove temporary folders | ||||||||
| [@baseapp-frontend/components] Temporary files cleaned. | ||||||||
| [@baseapp-frontend/components] Build completed successfully. # build completed | ||||||||
| [@baseapp-frontend/components] Syncing dist folder to consumer app... # sync the build output with the consumer app (baseapp-frontend-template) | ||||||||
| [@baseapp-frontend/components] Sync completed successfully. | ||||||||
| ``` | ||||||||
| **Disclaimer** | ||||||||
|
|
||||||||
| The dev mode is a powerful tool that makes live testing of changes very convenient by automatically rebuilding packages as you edit files. | ||||||||
|
|
||||||||
| However, note that for packages like `@baseapp-frontend/design-system` and `@baseapp-frontend/components`, the watch process can trigger multiple build tasks upon every file change. | ||||||||
|
|
||||||||
| This continuous rebuild may lead to increased memory consumption and CPU usage if you’re making a lot of simultaneous changes. | ||||||||
|
|
||||||||
| It is recommended to use this live mode only at appropriate times rather than throughout your entire development phase. | ||||||||
|
|
||||||||
|
|
||||||||
| ## **PNPM Catalog Overview** | ||||||||
|
|
||||||||
| This monorepo manages some dependencies using pnpm catalogs. As a rule of thumb, we often add dependencies to the catalogs that are reused across multiple packages, rather than arbitrarily adding dependencies to these lists. This approach ensures that shared dependencies are centrally managed and consistently applied across the codebase. | ||||||||
|
|
@@ -181,7 +142,7 @@ If you need to install a package version that hasn't been published yet, follow | |||||||
|
|
||||||||
| 3. **Copy the Commit Hash**: | ||||||||
|
|
||||||||
| Push the code to GitHub and copy the last commit hash. You’ll need this hash to point your consumer app to the correct version of the package. | ||||||||
| Push the code to GitHub and copy the last commit hash. You’ll need this hash to point your consumer app to the correct version of the package. | ||||||||
|
|
||||||||
| 4. **Update Consumer App**: | ||||||||
|
|
||||||||
|
|
@@ -198,7 +159,7 @@ If you need to install a package version that hasn't been published yet, follow | |||||||
| - Option 1: Run the `restore-catalogs` script | ||||||||
|
|
||||||||
| Refer to the (Restore Catalog Entries)[https://github.com/silverlogic/baseapp-frontend/blob/master/README.md#restore-catalog-entries] section to reapply catalog entries. | ||||||||
|
|
||||||||
|
Comment on lines
161
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Markdown link syntax. The link text/URL are inverted. - Refer to the (Restore Catalog Entries)[https://github.com/silverlogic/baseapp-frontend/blob/master/README.md#restore-catalog-entries] section to reapply catalog entries.
+ Refer to the [Restore Catalog Entries](https://github.com/silverlogic/baseapp-frontend/blob/master/README.md#restore-catalog-entries) section to reapply catalog entries.📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.17.2)161-161: Reversed link syntax (MD011, no-reversed-links) 🤖 Prompt for AI Agents |
||||||||
| - Option 2: Revert the Commit | ||||||||
|
|
||||||||
| Revert the commit that removed the catalogs to restore them to their previous state: | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,3 @@ cypress/downloads | |
| # relay | ||
| /__generated__ | ||
| !/__generated__/.keep | ||
|
|
||
| # babel & tsc | ||
| /tmp-babel | ||
| /tmp-dts | ||
This file was deleted.
This file was deleted.
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.
🛠️ Refactor suggestion
Pin Node version in this workflow to avoid environment drift.
This job does not set up Node explicitly. Runners can change preinstalled Node versions, which can break Storybook builds or violate engines in package.json. Align with other workflows by pinning Node and enabling pnpm cache.
Add this before “Setup pnpm” (outside the selected lines):
🤖 Prompt for AI Agents