-
Notifications
You must be signed in to change notification settings - Fork 50
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
Embroider compatibility #140
Comments
@dfreeman thanks for your work on ECM. Do you have any idea what it would take to make ECM compatible with Embroider? |
I decided to check this out since ember-css-modules was the first obvious breakage when we tried Embroider. In an app, I can get a basic usage working with two hacks:
I have no idea what the fixes are, of course! But hopefully this is helpful. I believe there are additional issues when used in an addon—I'll take a look at report back. |
So the issues are similar with addons (at least an addon in a yarn workspace.) The For starters: embroider is running the htmlbars-plugins twice ... sorta. It always runs once with a moduleName includes the Embroider temp directory in it. It also runs with a moduleName a relative path like The latter issue blows up early because this function returns undefined. Once that's fixed, the latter run of the htmlbars-plugin seems to win and the I think this is good news though! Tweaking a funnel output path and fixing the meta.moduleName should be sufficient to make this compatible with Embroider. @ef4 would love to hear your thoughts! |
@lennyburdette if you can share a reproduction of the same template getting processed both ways (with and without an absolute path in Overall, the next steps I see here are:
|
I probably won't be able to dig deep on this in the next few days, but I'm hoping to have some time for it next week. Off the top of my head, it wouldn't surprise me if the double processing for addon files is our fault on the ECM side. We're plucking and merging some trees around to try and get a consistent view of the universe, and that looks a bit different for apps vs addons (but it's pretty fragile for both). @ef4 is there a sanctioned way for a v1 addon to detect that it's being consumed via Embroider's compatibility layer? For step 1, it seems like that might provide the simplest path to compatibility without rocking the boat for existing consumers. |
Some of these problems sound reminiscent of what I had to do in #128 (not merged) for achieving Module Unification compatibility. |
Here's a repo that reproduces the issues, with some hacks to get things temporarily working: https://github.com/lennyburdette/ember-css-modules-embroider I dug in a bit more and discovered that ember-css-modules's HTMLBars plugin for addon templates is instantiated by embroider twice:
|
@dfreeman Any plans to continue pursuing making css-moduels work with Embroider? Looking forward to having this working, which would put us closer to be able to use Embroider. |
@josemarluedke Yes! Unfortunately I've been pretty deep in a couple other projects at work recently and haven't had the chance to come back to this, but some necessary changes landed in Embroider not too long ago. My hope is to come back and get a drop-in Embroider compatible release out the door sometime in the next few weeks to unblock folks who are having to wait to adopt because of ECM. |
I wanted to post an update on this, since I know a lot of folks are anxious to eliminate ECM as an Embroider adoption hurdle. I have a branch locally that works for apps and addons on an initial build with Embroider, but at present Embroider isn't picking up CSS changes on rebuild—though interestingly, the JS modules do update. Tl;dr: this hasn't been forgotten, and forward progress is still happening! I'll continue to update here periodically, though hopefully before too much longer the update will just be "it's supported" and that will be that 🙂 |
Thanks heaps for the update.
…On Thu, Aug 29, 2019 at 6:33 AM Dan Freeman ***@***.***> wrote:
I wanted to post an update on this, since I know a lot of folks are
anxious to eliminate ECM as an Embroider adoption hurdle. I have a branch
locally that works for apps and addons on an initial build with Embroider,
but at present Embroider isn't picking up CSS changes on rebuild—though
interestingly, the JS modules *do* update.
Tl;dr: this hasn't been forgotten, and forward progress is still
happening! I'll continue to update here periodically, though hopefully
before too much longer the update will just be "it's supported" and that
will be that 🙂
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#140?email_source=notifications&email_token=AAE6EC3RSH7RM5TNWUYI343QG7F2DA5CNFSM4HDSVEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OPTXI#issuecomment-526186973>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE6ECZ5QK2DHHPPL5IHZSLQG7F2DANCNFSM4HDSVEBA>
.
|
Thanks for the update @dfreeman. Just FYI, for styles not updating, that's not a particular bug in ECM. It is a bug in Embroider and it is happening in regular CSS files. See embroider-build/embroider#309. |
@josemarluedke 🤦♂ I was about 2 minutes away from coming to that conclusion myself, I think—I can see that the file in I was reaching the "how on earth is this working when you take ECM out of the equation" point, and was about to go test that out. |
@dfreeman I can test that branch via ember-cli-notifications in emberclear, if ya need -- I'm hoping that it's my last blocker for embroider -- and then pushing it to production :) |
My specific issue is that that embroider tmp directory for ember-cli-notifications doesn't include the styles directory. that addon imports styles via: https://github.com/ynnoj/ember-cli-notifications/blob/master/addon/components/notification-container.js#L5 and my build gives this error:
|
There's now experimental support for Embroider in In the coming days/weeks we'll be fleshing out multiple test apps/addons with different build configurations here, so the more input we have to make sure we're covering our bases, the better 🙂 |
- Need beta version of Ember CSS Modules. See salsify/ember-css-modules#140 (comment) - Need full path because of our settings. See salsify/ember-css-modules@251a2d9#diff-04c6e90faac2675aa89e2176d2eec7d8R160 - Build seems to work, but when you actually visit localhost:4200, you get a Fastboot-related error.
Awesome, @dfreeman ! Thanks a lot for your work on this. I ran into a few issues when using the |
Thanks so much for taking the time to put together reproductions and open issues, @danwenzel! I suspect the |
Also doesn't seem to be working with ember-css-modules-sass: dfreeman/ember-css-modules-sass#8 |
Hi @dfreeman - Just checking to see if you've had a chance to look into these ⬆️ |
Hi @danwenzel, sorry for the long silence here! This is near the top of my "OSS-time" list of priorities, but unfortunately I've been underwater the past month or so and just haven't had much time to put into these things. That's not likely to change over the next couple weeks, but my plan right now is to set aside some time over the holidays to burn through my backlog of pending issues like this one. |
No problem, @dfreeman , thanks for the update! |
Hi @dfreeman - Checking in on this one. Any updates? |
I just published a new release of Unfortunately after exploring several possible approaches for supporting As-is, I think |
What's the status on this? |
Currently we support Embroider-based builds in v1.3.0 and greater of ECM, with the caveat that the @scottmessinger and I had chatted a bit about the possibility of configuring Longer-term I think the combination of Embroider's v2 addon api and template strict mode will likely enable a much lighter weight version of ECM that desugars to something very similar to what Scott describes here (though likely a bit more static, and without the need for a backing class). My focus both at work and in my OSS time is largely in other areas for at least the next few months (which should hopefully give both those things a bit more time to advance), but if anyone is interested in trying to drive things forward in the meantime I'm happy to find some time to share my current thinking. |
Based on Ember + Modern CSS, I wrote You can find an example of a migrated app in ember-container-query#167, but it's early to tell whether the CSS modules approach will extend well to many other Ember apps. I'm also not sure what CSS modules for addons and engines should look like just yet. If you can try out |
I haven't spent a lot of time thinking through this deeply yet, but the mental model for asset inclusion with Embroider is fairly different from the v1 version of the addon ecosystem.
This ultimately may or may not result in a change to the way users of this addon interact with CSS modules, but the guts of ECM today are almost certainly incompatible with Embroider and will need to be restructured for the new system.
The text was updated successfully, but these errors were encountered: