Skip to content
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

[addon-shim]: Narrowed down broccoli trees for optimized file watching #1901

Merged
merged 3 commits into from
May 8, 2024

Conversation

simonihmig
Copy link
Collaborator

@simonihmig simonihmig commented May 3, 2024

addon-shim is currently creating a broccoli tree based on the v2 addon's root folder, and funnelling that based on the entries in app-js/public-assets, and exposing these trees as treeForApp/treeForPublic for integration into a classic build.

The problem with this is that it will trigger a rebuild of the app when something changes outside of the folders where the actual files live in (like dist/_app_ for the app tree), most notably the ./src folder, causing the app watcher to fire multiple times in succession: once for the change in ./src, and later (when the rollup build has finished) for the change in ./dist.

The PR here optimizes this, by making the root folder that goes into the broccoli-funnel to be as close as possible to the actual files. So (assuming our opionionated v2 setup based on the blueprint), that would be /path/to/addon/dist/_app_ instead of /path/to/addon for the app tree, and same for the public tree.

This is one part of addressing the "ignoring source files" approach discussed in embroider-build/addon-blueprint#32, the other (for the addon tree that is not covered by addon-shim) is this PR: embroider-build/ember-auto-import#623

I tested this in a local installation, and it did have the desired effect (when combined with the other PR): when changing only source files and not having the addon's build running in parallel, the app would not rebuild, as it would be expected.

@mansona mansona added the bug Something isn't working label May 7, 2024
@ef4 ef4 merged commit 88a2219 into stable May 8, 2024
201 checks passed
@ef4 ef4 deleted the addon-shim-optimized-watching branch May 8, 2024 01:32
@github-actions github-actions bot mentioned this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants