Skip to content
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

Process css files so that they get digested paths for asset files #476

Merged
merged 3 commits into from
Nov 5, 2021

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Oct 18, 2021

This is required so that we can use cssbundling-rails and reference images that will receive digested paths

This is required so that we can use cssbundling-rails and reference images that will receive digested paths
@dhh
Copy link
Member

dhh commented Oct 19, 2021

Test errors?

@jcoyne
Copy link
Contributor Author

jcoyne commented Oct 19, 2021

Any idea how to run those tests? I see:

 $ bundle exec rake
/Users/jcoyne85/.rbenv/versions/2.7.2/bin/ruby -w -I"lib:lib" /Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/test_asset_url_processor.rb" "test/test_helper.rb" "test/test_quiet_assets.rb" "test/test_railtie.rb" "test/test_task.rb"
Run options: --seed 20295

# Running:

..............................................................................................................................................................

Finished in 9.315093s, 16.9617 runs/s, 83.3057 assertions/s.
158 runs, 776 assertions, 0 failures, 0 errors, 0 skips

@dhh
Copy link
Member

dhh commented Oct 19, 2021

Seems like it's one specific failure:

Error:
13
TestRailtie#test_task_precompile:
14
ArgumentError: nil is not a valid asset source
15
    /home/runner/bundle/ruby/2.5.0/gems/actionview-5.2.6/lib/action_view/helpers/asset_url_helper.rb:184:in `asset_path'
16
    /home/runner/work/sprockets-rails/sprockets-rails/lib/sprockets/rails/asset_url_processor.rb:9:in `call'
17

@valeronm
Copy link

valeronm commented Nov 1, 2021

@jcoyne @dhh Looks like the test failed because of this commit 408aae2. Versions with and without block are not interchangeable for this logic. $1 is calculated before calling #gsub in version without block and it contains value of any previously executed Regex.

@dhh dhh merged commit ccf8411 into rails:master Nov 5, 2021
jcoyne added a commit to sul-dlss/argo that referenced this pull request Nov 15, 2021
after the upgrade to sprockets-rails 3.3.0.
See rails/sprockets-rails#476
jcoyne added a commit to sul-dlss/argo that referenced this pull request Nov 15, 2021
after the upgrade to sprockets-rails 3.3.0.
See rails/sprockets-rails#476
@jrochkind
Copy link

Should this make it no longer necessary to use eg asset-url() helper introduced by sass-rails? all url() references in CSS are just transparently processed to use appropriate digested filenames automatically now? If you have a url() reference in CSS that is processed by sprockets, it will now be automatically transformed to use an appropriate path? Maybe only if it looks like a relative path?

I think something in this change broke one of my apps, which is now having trouble resolving some assets. I am trying to figure out what happened, and will file an issue if I can figure out more. But I'm trying to make sure I understand the intent and effect of this change, so asking here. Thanks!

@MtnBiker
Copy link

Just read the documentation and don't see a better way to have images show up. I'm using leaflet.js and some images are needed. I copied node_module/leaflet/dist/images/ to /public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants