phlex-reactive 0.2.0 → 0.2.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/CHANGELOG.md +17 -1
- data/lib/phlex/reactive/version.rb +1 -1
- data/lib/phlex/reactive.rb +23 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 458474fb8c8cdba105626b01860a196a32ebd144cbc79fd9140dc5fce937924f
|
|
4
|
+
data.tar.gz: 214a174853a11f054ed246a9cd5fa16c96133aaaf65c1eaa07716f9c61db1eb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4d6d052aa218e41555dc1d94ff4966e93dff8420dda1402974b470bff49050d4864c1d003c7ef6a2e27d33bbf1ef69bf3e384a8e9ac554d163ab59bdfa2a6e8
|
|
7
|
+
data.tar.gz: 713f21d6a6155e6dd11923ac756428868aac85074e82c969a1133863f68328a83547a5177d27b1b656a162d2363b352d7aaeaf5af79cdd5768ac86c043fe97d9
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,21 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.1]
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Zeitwerk eager-load crash in host apps.** A host app with
|
|
14
|
+
`config.eager_load = true` (the production default) runs
|
|
15
|
+
`Zeitwerk::Loader.eager_load_all`, which walked this gem's loader and raised
|
|
16
|
+
`Zeitwerk::NameError` on two files that don't follow Zeitwerk's
|
|
17
|
+
file→constant rule: `version.rb` (defines `VERSION`, not `Version`) and the
|
|
18
|
+
Rails generators under `lib/generators` (whose path/constant scheme is
|
|
19
|
+
intentionally non-Zeitwerk). The loader now requires `version.rb` up front and
|
|
20
|
+
ignores it, and ignores `lib/generators` (Rails loads generators itself), so
|
|
21
|
+
the gem eager-loads cleanly. Added a regression spec that calls
|
|
22
|
+
`eager_load_all`. No API changes.
|
|
23
|
+
|
|
9
24
|
## [0.2.0]
|
|
10
25
|
|
|
11
26
|
### Added
|
|
@@ -49,6 +64,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
49
64
|
scaffolds a reactive component (and an RSpec spec when the app uses RSpec),
|
|
50
65
|
state-backed by default or record-backed with `--record`.
|
|
51
66
|
|
|
52
|
-
[Unreleased]: https://github.com/mhenrixon/phlex-reactive/compare/v0.2.
|
|
67
|
+
[Unreleased]: https://github.com/mhenrixon/phlex-reactive/compare/v0.2.1...HEAD
|
|
68
|
+
[0.2.1]: https://github.com/mhenrixon/phlex-reactive/compare/v0.2.0...v0.2.1
|
|
53
69
|
[0.2.0]: https://github.com/mhenrixon/phlex-reactive/compare/v0.1.0...v0.2.0
|
|
54
70
|
[0.1.0]: https://github.com/mhenrixon/phlex-reactive/releases/tag/v0.1.0
|
data/lib/phlex/reactive.rb
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
require "zeitwerk"
|
|
4
4
|
require "globalid"
|
|
5
5
|
|
|
6
|
+
# VERSION is a plain constant, not a Zeitwerk-managed file (it defines VERSION,
|
|
7
|
+
# not Version). Require it up front and ignore the file below so the loader
|
|
8
|
+
# never tries to load it — otherwise eager_load_all (host app with
|
|
9
|
+
# config.eager_load = true) raises Zeitwerk::NameError.
|
|
10
|
+
require_relative "reactive/version"
|
|
11
|
+
|
|
6
12
|
module Phlex
|
|
7
13
|
# phlex-reactive: reactive Phlex components for Rails.
|
|
8
14
|
#
|
|
@@ -125,8 +131,23 @@ end
|
|
|
125
131
|
|
|
126
132
|
loader = Zeitwerk::Loader.new
|
|
127
133
|
loader.tag = "phlex-reactive"
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
# Root is lib/ so files map to the Phlex::Reactive namespace
|
|
135
|
+
# (lib/phlex/reactive/foo.rb -> Phlex::Reactive::Foo).
|
|
136
|
+
lib = File.expand_path("..", __dir__)
|
|
137
|
+
loader.push_dir(lib)
|
|
138
|
+
# The gem-name shim (`require "phlex-reactive"`) is a plain require, not a
|
|
139
|
+
# managed file.
|
|
140
|
+
loader.ignore("#{lib}/phlex-reactive.rb")
|
|
141
|
+
# version.rb defines VERSION (a constant, not a `Version` class) and is required
|
|
142
|
+
# above — Zeitwerk must not try to load it.
|
|
143
|
+
loader.ignore("#{lib}/phlex/reactive/version.rb")
|
|
144
|
+
# Rails generators are discovered and loaded by Rails' own generator system,
|
|
145
|
+
# not the app autoloader. Their path/constant scheme
|
|
146
|
+
# (generators/phlex/reactive/... defining Phlex::Reactive::Generators::...)
|
|
147
|
+
# deliberately doesn't follow Zeitwerk's rules, so the loader must ignore them.
|
|
148
|
+
loader.ignore("#{lib}/generators")
|
|
149
|
+
# The engine is required explicitly below (only when Rails is present) and must
|
|
150
|
+
# not be eager-loaded before that.
|
|
130
151
|
loader.do_not_eager_load("#{__dir__}/reactive/engine.rb")
|
|
131
152
|
loader.setup
|
|
132
153
|
|