plutonium 0.53.0 → 0.53.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1575a79af57aa89f49041cbdb1e31364cea08fb3d541398e095772470a3da6b8
4
- data.tar.gz: a3d4dfebbec5836c9557c903393f7deebcfb17b94ca8d61ccb5a1dd1ffbd7aee
3
+ metadata.gz: 7470b409578e020a7a12c57bcce9df7d774795aaa4e4cad97cd2267861eeb8ba
4
+ data.tar.gz: 1baaad41e2a667896eb189e2875fbdc3099fd7e613755137e7afc851372ca00d
5
5
  SHA512:
6
- metadata.gz: 8c6954af1d7e64be809c28e06140b5660f58e94ec254fe2960c4d0b28b615f515df84d107528899d791ab3cc5bf38ac18cf623aa4c00d3a683bf7b963b96bc47
7
- data.tar.gz: a5f6a8ea0ad4e9fafc6559aac4b488c131a6c796c58506a49a49e8088dd3408cd04641ab4ffef357b66a373f88bd6c99476eb2d1cd7cb79eaaf2c993c6322cf5
6
+ metadata.gz: 672f79ac91915eab2127dc46baac52ec0b14052d161374160cb39b2261fae11618d68b01793c5caa596cbf0369880c811bbca7890e4ed15f327c50959985e35f
7
+ data.tar.gz: 0ff4f64b3833d6a3e6d573bf05553fa100361f4eada6f534eb0b67251fb988294b32a6bb93711dfdd93a238bdf3373094de8a58686eb6bf59d0de92c78adc89a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.53.1] - 2026-05-31
2
+
3
+ ### 🐛 Bug Fixes
4
+
5
+ - *(routing)* Tolerate non-Plutonium engines during route reload
1
6
  ## [0.53.0] - 2026-05-31
2
7
 
3
8
  ### 🚀 Features
@@ -22,8 +22,11 @@ module Plutonium
22
22
  #
23
23
  # @return [void]
24
24
  def clear!
25
- resource_route_config_lookup.clear
26
- engine.resource_register.clear
25
+ if engine
26
+ resource_route_config_lookup.clear
27
+ engine.resource_register.clear
28
+ end
29
+
27
30
  super
28
31
  end
29
32
 
@@ -98,9 +101,14 @@ module Plutonium
98
101
 
99
102
  # Returns the current engine for the routes.
100
103
  #
101
- # @return [Class] The engine class (Rails application or custom engine).
104
+ # Memoizes via defined? so a nil result (non-Plutonium route set) is cached
105
+ # instead of being recomputed on every call.
106
+ #
107
+ # @return [Class, nil] The owning engine, or nil if not a Plutonium engine.
102
108
  def engine
103
- @engine ||= determine_engine
109
+ return @engine if defined?(@engine)
110
+
111
+ @engine = determine_engine
104
112
  end
105
113
 
106
114
  # @return [Hash] A lookup table for resource route configurations.
@@ -112,12 +120,21 @@ module Plutonium
112
120
 
113
121
  private
114
122
 
115
- # Determines the appropriate engine based on the current scope.
123
+ # Determines the Plutonium engine that owns this route set, if any.
124
+ #
125
+ # Plutonium engines follow the SomeModule::Engine convention. A route set
126
+ # with no module scope belongs to the application. Anything else (e.g.
127
+ # graphql-ruby's Graphql::Dashboard, whose engine class is the module
128
+ # itself with no nested ::Engine) is not a Plutonium engine and has nothing
129
+ # for us to manage, so we return nil and let #clear!/#draw skip it rather
130
+ # than raise during route reload.
116
131
  #
117
- # @return [Class] The determined engine class.
132
+ # @return [Class, nil] The owning engine, or nil if not a Plutonium engine.
118
133
  def determine_engine
119
134
  engine_module = default_scope&.fetch(:module)
120
- engine_module.present? ? "#{engine_module.camelize}::Engine".constantize : Rails.application.class
135
+ return Rails.application.class if engine_module.blank?
136
+
137
+ "#{engine_module.camelize}::Engine".safe_constantize
121
138
  end
122
139
 
123
140
  # Creates a resource configuration hash.
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.53.0"
2
+ VERSION = "0.53.1"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.53.0",
3
+ "version": "0.53.1",
4
4
  "description": "Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, AI-ready.",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.53.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
@@ -1229,7 +1229,7 @@ metadata:
1229
1229
  homepage_uri: https://radioactive-labs.github.io/plutonium-core/
1230
1230
  source_code_uri: https://github.com/radioactive-labs/plutonium-core
1231
1231
  post_install_message: |
1232
- ⚠️ Plutonium 0.53.0 — breaking change
1232
+ ⚠️ Plutonium 0.53.1 — breaking change
1233
1233
 
1234
1234
  Entity-scoped URL helpers and path params have been renamed from
1235
1235
  `<entity>_scope_*` to `<entity>_scoped_*`.