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

Ensure style compilation works properly with ember-cli >= 3.18 #934

Merged
merged 4 commits into from
Aug 27, 2021

Conversation

stefanpenner
Copy link
Collaborator

@stefanpenner stefanpenner commented Aug 23, 2021

Bump test-packages/support’s to known failing version of ember-cli for debugging.

I'm using this PR to help narrow down specific CI failures across platforms.

(context: this is an exploratory fix for -> #927)


[fixes #927]

@stefanpenner stefanpenner marked this pull request as draft August 23, 2021 21:52
@stefanpenner stefanpenner changed the title Bump test-packages/support’s to known failing version of ember-cli fo… Bump test-packages/support’s to known failing version of ember-cli for debugging Aug 23, 2021
@ef4
Copy link
Contributor

ef4 commented Aug 25, 2021

These tests haven't been ported to scenario-tester yet, which is why we didn't see this sooner.

@stefanpenner
Copy link
Collaborator Author

stefanpenner commented Aug 25, 2021

@ef4 ya porting to scenario-tester seems critical. My prioritization for this PR though is: 1) land a fix 2) migrate tests scenario-tester as it seems like (1) basically blocks (2). WDYT?

I'll sink up with @thoov to understand the scenario-tester migration stuff better, and attempt to lend a hand.

…ange

Ember 3.18 moves add-on styles into `<addon-name>/__COMPILED_STYLES`, this isn’t compatible with embroider, so we move it back…
@stefanpenner stefanpenner changed the title Bump test-packages/support’s to known failing version of ember-cli for debugging handle ember-cli >= 3.18's __COMPILED_STYLES dir change Aug 27, 2021
@stefanpenner stefanpenner added the bug Something isn't working label Aug 27, 2021
@@ -97,6 +99,11 @@ export default class V1App {
return dirname(emberCLIPackage);
}

@Memoize()
get hasCompiledStyles() {
return semver.gte(JSON.parse(readFileSync(`${this.emberCLILocation}/package.json`, 'utf8')).version, '3.18.0');
Copy link
Collaborator Author

@stefanpenner stefanpenner Aug 27, 2021

Choose a reason for hiding this comment

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

@rwjblue I'm open to suggestions to detecting this in a different way...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ya this seems good to me, especially since we already have the this.emberCLILocation setup

@stefanpenner stefanpenner marked this pull request as ready for review August 27, 2021 04:17
@@ -738,6 +738,21 @@ export default class V1Addon {
private buildAddonStyles(built: IntermediateBuild) {
let addonStylesTree = this.addonStylesTree();
if (addonStylesTree) {
if (this.app.hasCompiledStyles) {
Copy link
Collaborator Author

@stefanpenner stefanpenner Aug 27, 2021

Choose a reason for hiding this comment

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

rather then detected this for each add-on, i memoize the result on the app instance and reuse said result for each addon's addon styles

@@ -14,7 +14,7 @@
"broccoli": "^3.4.2",
"console-ui": "^3.0.0",
"ember-auto-import": "^1.2.21",
"ember-cli": "~3.17.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once this is green, I would like to test bumping this to latest. I have chosen the most conservative bump to minimize variables as I resolve the issue at hand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've bumped to latest and everything remains green

@stefanpenner
Copy link
Collaborator Author

stefanpenner commented Aug 27, 2021

Now that this is green, let me try to bump all the ember-cli to latest. If that doesn't work, i'll roll that change back so we can land this.

Co-authored-by: Robert Jackson <rjackson@linkedin.com>
@rwjblue rwjblue merged commit 7a825df into master Aug 27, 2021
@rwjblue rwjblue deleted the compiled-styles-issue branch August 27, 2021 19:43
@rwjblue rwjblue changed the title handle ember-cli >= 3.18's __COMPILED_STYLES dir change Ensure style compilation works properly with ember-cli >= 3.18 Aug 27, 2021
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.

Test Failures suggest potential incompatibilities with ember-cli 3.18+
3 participants