Add Spa.load_detached_action, decorator identifier rule, npm updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-10 20:50:57 +00:00
parent d047b49d39
commit 2f2cf41139
26 changed files with 492 additions and 76 deletions

View File

@@ -1026,6 +1026,30 @@ Unhandled errors auto-show flash alert.
---
## DATA FETCHING (CRITICAL)
**DEFAULT**: Use `Model.fetch(id)` for all single-record retrieval from JavaScript.
```javascript
const user = await User_Model.fetch(1); // Throws if not found
const user = await User_Model.fetch_or_null(1); // Returns null if not found
```
Requires `#[Ajax_Endpoint_Model_Fetch]` on the model's `fetch()` method.
Auto-populates enum properties and enables lazy relationship loading.
**If model not available in JS bundle**: STOP and ask the developer. Bundles should include all models they need (`rsx/models` in include paths). Do not create workaround endpoints without approval.
**Custom Ajax endpoints require developer approval** and are only for:
- Aggregations, batch operations, or complex result sets
- System/root-only models intentionally excluded from bundle
- Queries beyond simple ID lookup
Details: `php artisan rsx:man model_fetch`
---
## BROWSER STORAGE
**Rsx_Storage** - Scoped sessionStorage/localStorage with automatic fallback and quota management. All keys automatically scoped by session, user, site, and build. Gracefully handles unavailable storage and quota exceeded errors. Storage is volatile - use only for non-critical data (caching, UI state, transient messages).