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

WIP Sort addon css by package name #1866

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

raycohen
Copy link
Contributor

@raycohen raycohen commented Apr 4, 2024

Fixes #1862

While broccoli-concat doesn't guarantee order, the effective order of addon css in (most?) classic builds seems to be alphabetical by package name.

Also, the order of app.import'd styles was being reversed from what the classic build had, in addition to not coming before addon css.

@raycohen raycohen marked this pull request as draft April 4, 2024 21:40
@raycohen raycohen changed the title Sort addon css by package name WIP Sort addon css by package name Apr 4, 2024
ef4
ef4 previously approved these changes Apr 5, 2024
Copy link
Contributor

@ef4 ef4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

We may want to retarget it against the stable branch so it's easier to release sooner. I think it will apply cleanly there.

@raycohen raycohen changed the base branch from main to stable April 5, 2024 18:32
@raycohen raycohen changed the base branch from stable to main April 5, 2024 18:38
@raycohen
Copy link
Contributor Author

raycohen commented Apr 5, 2024

stable and main differ slightly inside impliedAddonAssets

}
} else {
result.push(resolve.sync(mod, options));
}
}
if (styles.length) {
result = [...styles, ...result];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unshifting the group of styles from each package to the overall list, which reverses the order and we no longer want. then in implicitScriptsAsset the entire list was getting (re-)reversed. We don't need that reverse either now.

@BlueCutOfficial
Copy link
Collaborator

BlueCutOfficial commented Apr 9, 2024

impliedAddonAssets code is reused to replace the assets generated by compat-app-builder.ts with virtual contents. If this PR is merged we probably want to double-check #1805 and #1811 and reintegrate the changes in the new virtual-content generators.

@mansona
Copy link
Member

mansona commented Apr 10, 2024

Just a quick note on how to make sure this continues to work for the upcoming major release: @ef4 is correct that you should target stable with a change like this so that it could be released sooner than the next major, but we can't ensure that this is going to keep working unless we make sure to add a test that verifies the output is in the correct order. If this gets merged to stable and we then forward-port the test to the main branch we can ensure that the sort ordering is still correct even though the implementation is completely different 👍

@raycohen
Copy link
Contributor Author

I will look into testing this. Right now we're getting by with patch-package (with a slightly different diff) but we'll want to get off that eventually

@mansona mansona dismissed ef4’s stale review April 29, 2024 14:29

Needs changes: target main and add a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to control order of addon implicit styles?
4 participants