-
Notifications
You must be signed in to change notification settings - Fork 152
[WIP] feat: Augment @css-blocks/ember-cli to be a fully-fledged ember addon. #174
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
Conversation
- Works with Ember apps using Module Unification - Dummy app works with CSS Blocks - Modify glimmer analyzer to use more concepts from Glimmer's template tree analysis package. - Broccoli plugin cleans up blocks files correctly now. - Glimmer playground demo uses updated ember-cli addon.
Glad to see this progress! I happened to also start trying to do this exact same thing this week. A few observations from comparing notes:
Tomorrow I will see about getting this branch running and look for opportunities to PR some of these things. |
@ef4 awesome – great feedback! Would love to see your take on this, feel free to iterate on this branch. Let me know if it gives you any trouble when spinning it up. I will happily defer to you, @tomdale and @stefanpenner on most Ember related architecture decisions since you have far more context into that universe that Chris or I – as long as we preserve the static analysis guarantees that CSS Blocks requires 🙂 Re: module unification, I agree it would be spectacular to maintain support for classic apps, and your approach of treating each template as an entrypoint is a great way to do that. I didn't get that together because with the current implementation (module unification only) I was able to leverage much of the work already done for Glimmer. I'd love to see apps that support module unification use the |
Yes, exactly. Maybe we should even name them |
I should clarify: switching to module unification by itself is not sufficient to get a complete static dependency map of an Ember app. There are too many other dynamic escape valves, ranging from the |
I was trying to test this branch against an actual module unification ember app and immediately ran into gaps between how MU works and how GlimmerJS works. For example, GlimmerJS doesn't understanding routes, so a hello-world ember app with just I'm going to make things work first without trying to reuse the GlimmerJS analyzer against Ember (regardless of whether using MU or not). The work to unify is not specific to css-blocks. EDIT to add: part of what I said here was incorrect, I was confusing myself by running the wrong thing. Continuing to investigate -- jury is still out on whether we should try to use the glimmer analyzer on MU. |
Hm, the addon in this branch should discover route templates / stylesheets and automatically use them as entry points – hopefully that is what your edit is referencing! If it still isn't discovering them, I'd call that a bug. Re: MU static escape valves – I remember way back when we were building out our Glimmer experiment a while back, files using the {{!-- import ComponentName1 ComponentName2--}}
{{component dynamicName}} If Is this still a pattern in Glimmer, and/or one that will be used in MU Ember apps? |
Yes, I did get past that one.
It's possible addition, but it's not part of MU as written, so it would be premature to assume anything about its exact implementation. How have you been testing this branch? I'm unable to get the dummy app to actually run. I hit and solved the following
Next issue is that the analyzer is attempting to locate templates under (But also I suspect it's incorrect to try to use glimmer-resolution-map-builder against Ember apps -- that is a glimmerJS only library. Instead the common interface is glimmer-resolver, which is tested against both glimmerJS and ember.) |
I've been testing in the dummy app – your steps to fix seem correct, but make sure that you built version of
That logic lives in @css-blocks/ember-cli/index.js:140-160. Its not particularly elegant, but the different paths are resolved there. Sounds like they're not being passed down to either
Probably! I'm not privy to much of the project toolchain split – will happily defer to the subject matter experts here. Although as an integrator, since both projects use resolution maps at their core, I'd expect some kind of consolidated tooling to be available ¯\_(ツ)_/¯ |
Incidentally, you're probably seeing annoying warnings about "Missing package directory" in simple-html-tokenizer. I fixed that upstream. |
I now have this branch working locally, I was missing a few more places that needed to use the fork of |
Here's a PR targeting your branch, to start adding acceptance tests. Plus it contains some questions about desired semantics: #178 |
Closing in favor of #185 👍 |
Major Work in Progress!
Currently:
Still To Do:
Analyzer
,Analysis
and template -> analysis lookup can be improved.@block-reference
s. This will require re-integration with the custom loader already in-repo.Open questions:
css-blocks.css
css file and inject a new<link>
tag in the base page, or do we automatically concat our styles withapp.css
or some other file?