-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Remove Sprockets dependency #48
Conversation
Hi @barrywoolgar no worries! thanks a lot for working on this 👍🏼
Yeah, maybe that's a good solution, so it will work for both scenarios with no extra logic. |
No problem, I only thought of the Base64 idea when I was writing the PR, otherwise I would have done it that way to start with! |
1039074
to
f245427
Compare
OK, I've switched to Base64 encoded data URIs and that's appears to be working well. I've also added a method to the installer that will automatically copy Maily's |
This leaves only the use of SCSS relying on Sprockets. It's tempting to try and resolve that in this PR too, but perhaps that should be a separate undertaking? (Edited to remove some too-early-in-the-morning lack of thinking) |
hi @barrywoolgar 👋🏼
That would be amazing, I think it makes sense to do it here in the same PR, so we can ship a new version compatible with both engines, with no extra steps or workarounds 👌🏼 We can just use the simple approach we took with the js: move to plain css <style>, in a partial https://github.com/markets/maily/blob/master/app/views/maily/shared/_javascript.html.erb. We can use css variables for current sass vars. This will close #47 and also will allow us to remove this "hack" 👇🏼 too (as we wont need this dep anymore 🎉 ) Lines 18 to 22 in 6d1caef
After this change, it would be a good time to cut a v1.0 :) |
…ting SCSS to CSS This now makes Maily compatible with Webpacker/API projects by not requiring Sprockets be loaded in the parent application.
OK, that negates quite a few of the changes I originally made but that can only be a good thing! I have elected to use ERB variables instead of CSS variables as a final mercy to IE users. I have also removed the functionally-orphaned SCSS file completely as that will likely only cause confusion at a later date. It's easy enough for gem developers to convert back and forth if and when necessary. In future a proper pipeline can be established once we know what that should look like... |
Thank you so much @barrywoolgar! I just made a first quick review and everything seems fine ✅ to me. I'll make a second pass this weekend and merge it! |
merged 🚀 @barrywoolgar less deps, less lines, simpler approach, more "compatible" 👌🏼 nice pull request! I'll make some tweaks and prepare new release. Thanks! |
@barrywoolgar v1.0.0 pushed 🚀 to RubyGems:
Thanks a lot for working on this and making Maily simpler 👏🏼 |
Hurray! No problem at all, thanks for your patience while I took the long way round :) Congrats on v1... now, what's for v2? |
👍🏼 👍🏼 My vague thoughts for v2 😄 :
|
Those all sound very good! I've got a patch that applies Premailer if it's available, so the email markup is closer to what is sent when using it (ie. lots of inline styles), and another that handles namespaced mailers a bit better when listing them in the sidebar. I need to catch up on some things in Real Life first though, but I'll generate some PRs when I get a bit of free time :) All the best! |
Hello @markets, this is the long overdue PR in response to #46 - sorry for the delay.
This resolves the basic problem of a Rails app not being able to boot after adding the gem to the project if Sprockets is not enabled. The README has been updated to describe the problem and provide instructions for a workaround.
Now in the case of Sprockets being disabled:
--skip-sprockets
to bypass this error, so they can implement the workaround for CSS stylesThe use of emoji might offend, especially with regard to the logo, so I'm very open to suggestions here. Perhaps they should be inlined using Base64 data URLs instead?
Thanks