dfm_web 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -9
- data/lib/dfm_web/auto_assets.rb +2 -1
- data/lib/dfm_web/version.rb +2 -1
- 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: a1f0a1fe0e231e125406923fa57d9805f42ca1149464b0e97bbbcdb232ea8851
|
|
4
|
+
data.tar.gz: 77c08f0e3b29d713670b9e9c507a62e4d0a128bb17ef9877b890201cd450c841
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38e0160e5140bb5b346c4b58870242c2a3b8a5bf5b3d8b076f15023e216f2024564fccbd53277238ce7e51227031a1c9d452da29ffdd6833a0656bc06b4beb56
|
|
7
|
+
data.tar.gz: 890354241f3833acdb783737f34e215ea74174d38fd9c4d0f524165129adcfde224a2b253873f745c97eb1bc0d259e1df4618e419d7983fefcab15735bba7cf7
|
data/README.md
CHANGED
|
@@ -32,21 +32,22 @@ application.html.erb
|
|
|
32
32
|
|
|
33
33
|
## Rails 8 Automatic Asset Inclusion
|
|
34
34
|
|
|
35
|
-
DfmWeb
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
DfmWeb adds its stylesheet and script tags to each full HTML page the app
|
|
36
|
+
renders, whatever the status code, so forms re-rendered with a 422 get them too.
|
|
37
|
+
A full page starts with `<!doctype html>` (leading HTML comments are OK) and has
|
|
38
|
+
`<html>` and `<head>` elements.
|
|
38
39
|
It supports both Propshaft and Sprockets. No activation call, import map, or
|
|
39
40
|
consumer build tool is needed. Layout partials still need to be rendered by the
|
|
40
41
|
application, as above.
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
DfmWeb CSS is inserted before application styles. Existing explicit DfmWeb asset tags
|
|
43
44
|
are preserved without duplication. Rails helpers supply asset URLs and CSP
|
|
44
45
|
nonces; DfmWeb does not relax the application's CSP.
|
|
45
46
|
|
|
46
47
|
Streaming responses, downloads, fragments, non-HTML responses, and documents
|
|
47
48
|
with HTML parsing errors are not modified. Use explicit tags for those layouts.
|
|
48
|
-
|
|
49
|
-
bundle
|
|
49
|
+
DfmWeb assets hidden inside application bundles cannot be detected. If you already
|
|
50
|
+
bundle DfmWeb CSS or JavaScript, disable automatic inclusion:
|
|
50
51
|
|
|
51
52
|
```ruby
|
|
52
53
|
Rails.application.config.dfm_web.auto_include_assets = false
|
|
@@ -142,10 +143,11 @@ have to be run as part of application startup.
|
|
|
142
143
|
|
|
143
144
|
# Changelog:
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
See [lib/dfm_web/version.rb](lib/dfm_web/version.rb) for the full version history.
|
|
147
|
+
|
|
148
|
+
### Version 8:
|
|
146
149
|
* Rails 8+ and Ruby 3.2+; native Propshaft and retained Sprockets integration.
|
|
147
|
-
*
|
|
148
|
-
minification.
|
|
150
|
+
* Image free CSS-only backgrounds; no ERB asset processing or minification.
|
|
149
151
|
* Automatic asset inclusion with opt-outs and portable, repeatable JavaScript
|
|
150
152
|
startup, with or without Turbo.
|
|
151
153
|
* Keyboard-accessible navigation and flash dismissal controls.
|
data/lib/dfm_web/auto_assets.rb
CHANGED
|
@@ -16,13 +16,14 @@ module DfmWeb
|
|
|
16
16
|
def include_dfm_web_assets
|
|
17
17
|
return unless Rails.application.config.dfm_web.auto_include_assets && dfm_web_auto_include_assets
|
|
18
18
|
return if request.head? || response.committed? || response.headers["Content-Disposition"]
|
|
19
|
-
return
|
|
19
|
+
return if response.redirect? || response.media_type != "text/html"
|
|
20
20
|
return if defined?(ActionController::Live) && is_a?(ActionController::Live)
|
|
21
21
|
|
|
22
22
|
parts = response_body
|
|
23
23
|
return unless parts.is_a?(String) || (parts.is_a?(Array) && parts.all? { |part| part.is_a?(String) })
|
|
24
24
|
|
|
25
25
|
body = Array(parts).join
|
|
26
|
+
return if body.blank?
|
|
26
27
|
return unless body.match?(/\A(?:\s*<!--.*?-->)*\s*<!doctype\s+html\b[^>]*>\s*<html\b[^>]*>\s*<head\b/im)
|
|
27
28
|
|
|
28
29
|
document = parse_dfm_web_document(body)
|
data/lib/dfm_web/version.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module DfmWeb
|
|
2
|
-
VERSION = "8.0.
|
|
2
|
+
VERSION = "8.0.1"
|
|
3
3
|
end
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
# Version History
|
|
7
7
|
|
|
8
|
+
# 8.0.1 Auto-included assets are now injected into non-2xx HTML responses so Turbo does not reload on 422 validation errors.
|
|
8
9
|
# 8.0.0 Rails 8+, Propshaft/Sprockets, readable plain assets, automatic startup/inclusion, and accessible controls. Removed IE support.
|
|
9
10
|
# 5.0.4 Removed verlag font from the font-family list as no one should be using it. Font itself was never present.
|
|
10
11
|
# 5.0.2 Scale the new font to 88% to match the old one and use black instead of dark gray for the base.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dfm_web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.0.
|
|
4
|
+
version: 8.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jacob Duffy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|