Comments (4)
It's worth noting that propshaft already does raise a MissingAssetError
for assets that aren't resolved when the asset is referenced directly in an actionview helper method like javascript_include_tag
, etc., as seen here:
propshaft/lib/propshaft/helper.rb
Lines 3 to 5 in 62476fa
The code linked in @tiagobabo's post is specific to assets that are referenced in a url(...)
value within a CSS file, which are potentially transformed by the CssAssetUrls
processor.
Note, however, that some expressions inside url()
should never be transformed (e.g. an inline data-URI or a fully qualified URL to an external domain). This explains why the current implementation (of not raising an error) can be useful.
I do see the value in adding such a configuration to throw an exception rather than just logging a warning if an asset inside url()
can't be resolved, but it seems like it would have to be restricted to only apply for expressions inside url()
that makes sense to be transformed (e.g. relative URLs).
from propshaft.
You're right, this only happens for assets required inside url(...)
, thanks for clarifying that.
from propshaft.
I’ll close this issue for now as it’s not a bug but a feature request, and from my experience logging provides a better workflow than raising. If anyone has further input, feel free to comment.
from propshaft.
My original implementation was for a raise
, but when I started migration my own app from sprockets to propshaft, I noticed that it was easier to let all errors to be logged and fix them in batches than doing the crash-fix-reload-crash-fix-reload cycle.
Is there a reason why raising would be better? I'm asking because between our two experiences we might figure out a third option that might be better than logging/raising
from propshaft.
Related Issues (20)
- Using images inside node_modules HOT 3
- Newly added files that are already digested aren't available in development HOT 4
- `assets:clean` task is not cleaning predigested assets with `.digest` in the name HOT 7
- Allow digested files with the same name prefix
- Upgrade doc refers to 'packages.json' HOT 1
- Current version v0.7.0 contains the broken #118 asset_host handling HOT 1
- Revisit Gzip compression support? HOT 15
- SCSS files digested by default HOT 1
- allow a configurable digest length HOT 11
- Using Propshaft::Asset#content with UTF-8 encoding HOT 5
- Add single files to assets compilation HOT 2
- Digests required in dev? HOT 4
- missing require rack/version causing issues with sidekiq HOT 3
- CSS Variable Images HOT 3
- Builds folder not appearing in asset load path causing 'home.css' asset not found error HOT 3
- Maybe another race condition with webpack in development HOT 4
- Source Map loading errors introduced in 0.9 HOT 3
- Assets and Rails.application.config.relative_url_root HOT 2
- Exclude certain assets declared in importmap HOT 2
- Cannot load assets from vendor/assets as per docs HOT 5
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 propshaft.