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
base: main
Are you sure you want to change the base?
WIP Sort addon css by package name #1866
Conversation
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.
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.
…ct order in advance" This reverts commit 7d31be5.
} | ||
} else { | ||
result.push(resolve.sync(mod, options)); | ||
} | ||
} | ||
if (styles.length) { | ||
result = [...styles, ...result]; |
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.
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.
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 👍 |
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 |
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.