-
Notifications
You must be signed in to change notification settings - Fork 247
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
sprockets 4 manifest.js location #369
Comments
The manifest can be in any location that is part of the sprockets load path. |
It raises |
Oh, got it, yeah I think we should remove that check cc @schneems |
Thinking aloud I don't see a benifit of making the location of the file customizable. While technically yes you can put that config in any file that will be auto loaded we need some way to know that the project is Sprockets 4 ready. I don't want to ease that requirement unless there's a good reason to do so. That's how I feel about Rails apps, but not engines. I see a useful error message as, well useful. If we get rid of the error message we need something else to ease people into the upgrade process to Sprockets 4. I do think we should allow assets in engines/gems to not have to change anything to support the new version. I guess I would prefer that those work out of the box by default and require fewer changes (if indeed they do work out of the box). Maybe we could make the check for that file happen only after a precompile check failure? |
If the main reason for a useful message is to ease the transition, maybe there could be some sort of a silencer. Like "we couldn't find manifest.js in the correct location, please put it there. If you know what you're doing, set disable_manifest_strict_check = true to suppress this check" moving this check to "after-fail" is even cooler since it doesn't require any additional steps |
The silencer in this case is the presence of the file ;)
Yeah, i like this approach. Still error but only when a precompile asset isn't found. The only downside is that it becomes a runtime error instead of a boot time error. i.e. people may not hit the problem in dev (if they never go to a specific page that doesn't have a specific asset). Still I think this would be the best approach. |
Did this ever get resolved? I have a Rails engine for which I am unable to declare the |
This is a prove of concept to make Rails work with sprockets 4 beta. It helps to undestand a bit the concept of manifest. This issue is related too: rails/sprockets-rails#369
I had the same issue here. I was trying to use Sprockets 4 in a Rails engine without success. After some experiments, I could make it work by creating an empty Also I had to create the engine's manifest and include this manifest path as an additional precompile file in the engine config file. The manifest file and the engine config can be found in this POC. Considering that configuring the engine make it works, should Rails add that configuration by default for the Thanks! |
I actually fixed this pretty well. It works on Sprockets The answer was to add the
This way, the This works with Sprockets |
Just leaving this here for the future: Forcing the existence of this file in |
yes! my usecase exactly. i do not have the app folder too |
Just FYI @dreyks, this GitHub issue is referenced in the book Component Based Rails Applications (chapter 2). |
Is there a plan to make the location of
manifest.js
customizable?I have an app that consists from engines exclusively, so there's no
app
folder at all. There's one non-isolated engine, which serves as anapp
folder, e.g. it holds theapplication.html.erb
etc.Right now every engine has its own
application.js
file, and theapplication.html.erb
has `<%= stylesheet_link_tag engine_name %> where neededBut sprockets 4 requires me to have
manifest.js
located exactly atapp/assets/config
The text was updated successfully, but these errors were encountered: