Comments (5)
Hi @markets all that makes a lot of sense, thank you for the rapid response.
You're right, I had the Sprockets railtie commented out. However, this happens by default when the project is initialised with rails new my_app --skip-sprockets
so I may not be the only one to run into this.
As such, I do think it's worth allowing for the absence of config.assets
- and maybe displaying a warning when the generator is run? - so that just installing the gem doesn't risk "breaking" a streamlined app just by being in the Gemfile.
It's definitely an edge case though (and now this issue exists for anyone searching with the same exception), so I'd be happy to close this issue - unless you'd like a PR to address the boot crash issue?
from maily.
Hello, apologies for the delay in replying. I'm juggling some things at the moment, but I haven't forgotten!
from maily.
Hi @barrywoolgar and thanks for such a detailed description!
I usually use this gem in several apps with webpacker
with no problem, but that's because I still use sprockets
in combination (js -> webpack, css+images -> sprockets), so we don't faced the problem yet.
There is no "clear" way to use webpacker
in Rails engines currently (https://github.com/rails/webpacker/blob/master/docs/engines.md), and at the same time keep compatibility with the sprockets
version. From what I read in different issues and see in other gems with assets, it's possible, but still tricky and harder to maintain.
So I'd say, we have 2 feasible options to solve this situation:
a) as you pointed out above, provide "static" versions of the assets and inject a middleware to render those ones.
b) make maily
depend on sprocket-rails
(and load require "sprockets/railtie"
), so config.assets
will we available.
I think the first option a
will be nice (no extra deps and we can cut sass
dep too) but requires some analysis, work and testing. I'd try to go with b
for now (If I'm not wrong, sprocket-rails
is still a Rails 6 dep), so probably you only need to: require "sprockets/railtie"
in config/application.rb
.
Maybe in the future, if finally Rails settles to one pipeline approach, this will be easier for engines too.
from maily.
Yes, I think it's also commented out when you create a Rails API project.
As such, I do think it's worth allowing for the absence of config.assets - and maybe displaying a warning when the generator is run? - so that just installing the gem doesn't risk "breaking" a streamlined app just by being in the Gemfile.
Yeah! +1 to improve user experience and guidance for a friendly installation! --skip-sprockets
and --api
probably aren't not so rare these days.
from maily.
Closed by #48
from maily.
Related Issues (20)
- Email description - fetch from method comments
- Allow to hide emails
- Capture internal exceptions
- Lazy load hooks
- Engine doesn't render HOT 7
- Viewing an email gives undefined method `size' for nil:NilClass HOT 6
- Breaks if sass-rails is not present HOT 11
- Exception when running the install generator HOT 5
- Edit mail fails with slim as a template engine HOT 7
- Configured available locales not being picked up by maily HOT 3
- Inherited methods dont show on ui HOT 7
- Image as inline attachments not being showed HOT 10
- Email content rendered always as text HOT 4
- error | rails g maily:install HOT 7
- Arrays in arguments of mailer.register_hook is not supported HOT 1
- Remove sass and move to plain css HOT 1
- Hide the email form if allow_delivery is false HOT 1
- Notify (via email) template changes to developer
- Allow to add multiple hooks/versions per mail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maily.