propshaft 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/propshaft/version.rb +1 -1
- data/lib/propshaft.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ac96be7b15334f58662f5033d02375a23050328d28aca71058777cd1778ba6
|
4
|
+
data.tar.gz: bb4c8a1c289ce56c380da154c0174d6bef08a988cd7a4e53fe0193b05f62b092
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e082b706b8d3e1733805697fdb3f3520ba977531533ec1da6078277cf9e7d59c8a2cf79464653ec8d058ae98b40db10cf372bc3e260ea56194aa062cf7f501b0
|
7
|
+
data.tar.gz: eb18c451c949637476e936afcf88a656dad3f0ae7217d326fbb117390bfc3de7ae83e5fe71f66848739300d7d841ba113abf6704cb6c3e95ddae47d9ca674547
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Propshaft
|
2
2
|
|
3
|
-
Propshaft is an asset pipeline library for Rails. It's built for era where bundling assets to save on HTTP connections is no longer urgent, where JavaScript and CSS
|
3
|
+
Propshaft is an asset pipeline library for Rails. It's built for an era where bundling assets to save on HTTP connections is no longer urgent, where JavaScript and CSS are either compiled by dedicated Node.js bundlers or served directly to the browsers, and where increases in bandwidth have made the need for minification less pressing. These factors allow for a dramatically simpler and faster asset pipeline compared to previous options, like Sprockets.
|
4
4
|
|
5
|
-
So that's what Propshaft doesn't do. Here's what it
|
5
|
+
So that's what Propshaft doesn't do. Here's what it does provide:
|
6
6
|
|
7
7
|
1. **Configurable load path**: You can register directories from multiple places in your app and gems, and reference assets from all of these paths as though they were one.
|
8
8
|
1. **Digest stamping**: All assets in the load path will be copied (or compiled) in a precompilation step for production that also stamps all of them with a digest hash, so you can use long-expiry cache headers for better performance. The digested assets can be referred to through their logical path because the processing leaves a manifest file that provides a way to translate.
|
@@ -17,16 +17,16 @@ With Rails 7+, you can start a new application with propshaft using `rails new m
|
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
20
|
-
Propshaft makes all the assets from all the paths
|
20
|
+
Propshaft makes all the assets from all the paths it's been configured with through `config.assets.paths` available for serving and will copy all of them into `public/assets` when precompiling. This is unlike Sprockets, which did not copy over assets that hadn't been explicitly included in one of the bundled assets.
|
21
21
|
|
22
|
-
These assets can be referenced through their logical path using the normal helpers like `asset_path`, `image_tag`, `javascript_include_tag`, and all the other asset helper tags. These logical references are automatically converted into digest-aware paths in production when `assets:precompile` has been run (through a
|
22
|
+
These assets can be referenced through their logical path using the normal helpers like `asset_path`, `image_tag`, `javascript_include_tag`, and all the other asset helper tags. These logical references are automatically converted into digest-aware paths in production when `assets:precompile` has been run (through a JSON mapping file found in `public/assets/.manifest.json`).
|
23
23
|
|
24
24
|
Additionally, Propshaft ships with a CSS function called `asset-path("image.svg")` that'll be compiled into `url("/assets/image-f2e1ec14d6856e1958083094170ca6119c529a73.svg")` when doing `assets:precompile`. This function is applied to all `.css` files.
|
25
25
|
|
26
26
|
|
27
27
|
## Migrating from Sprockets
|
28
28
|
|
29
|
-
Propshaft does a lot less than Sprockets, by design, so it might well be a fair bit of work to migrate
|
29
|
+
Propshaft does a lot less than Sprockets, by design, so it might well be a fair bit of work to migrate if it's even desirable. This is particularly true if you rely on Sprockets to provide any form of transpiling, like CoffeeScript or Sass, or if you rely on any gems that do. You'll need to either stop transpiling or use a Node-based transpiler, like those in `jsbundling-rails` and `cssbundling-rails`.
|
30
30
|
|
31
31
|
On the other hand, if you're already bundling JavaScript and CSS through a Node-based setup, then Propshaft is going to slot in easily. Since you don't need another tool to bundle or transpile. Just to digest and serve.
|
32
32
|
|
data/lib/propshaft/version.rb
CHANGED
data/lib/propshaft.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: propshaft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|