create-prisma-php-app 5.0.0-alpha.25 → 5.0.0-alpha.26
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.
|
@@ -18,12 +18,19 @@
|
|
|
18
18
|
- Use `npm run create-swagger-docs` only when Swagger or OpenAPI output must be intentionally generated or refreshed.
|
|
19
19
|
- When package-script behavior matters, read `dist/docs/commands.md` first and inspect the actual `package.json` in the target project before assuming which scripts exist.
|
|
20
20
|
|
|
21
|
+
## PulsePoint-First Frontend Rules
|
|
22
|
+
|
|
23
|
+
- In full-stack Prisma PHP apps, treat PulsePoint as the primary JavaScript authoring model for frontend behavior.
|
|
24
|
+
- For page-local interactivity, prefer `index.php` or nested `layout.php` with a plain inline `<script>` that contains PulsePoint state and functions directly, and use `pp.fetchFunction(...)` for backend calls.
|
|
25
|
+
- Do not wrap inline PulsePoint code in `DOMContentLoaded`, IIFEs, manual `pp.mount()` calls, or custom scoping/bootstrap helpers. Prisma PHP scopes the component boundary and runs the script for you.
|
|
26
|
+
- Reserve plain browser JavaScript or TypeScript modules for reusable helpers in `ts/`, third-party libraries, low-level browser APIs, or behavior that does not belong inside a PulsePoint component boundary.
|
|
27
|
+
|
|
21
28
|
## Route File Conventions
|
|
22
29
|
|
|
23
30
|
- For PulsePoint-aware `index.php` and nested `layout.php`, keep file order as PHP first, then one parent HTML element; keep the PulsePoint `<script>` as the last child inside that same root element.
|
|
24
31
|
- `index.php` and nested `layout.php` must render a single parent HTML element. Treat that root like a React-style component boundary rather than loose sibling markup.
|
|
25
32
|
- For pages and nested layouts, author a plain single root element and let Prisma PHP inject the PulsePoint `pp-component` scope automatically.
|
|
26
|
-
- Author plain `<script>` tags inside that root when PulsePoint is needed. Do not manually add `type="text/pp"
|
|
33
|
+
- Author plain `<script>` tags inside that root when PulsePoint is needed. Put the PulsePoint code at the top level of that script. Do not manually add `type="text/pp"`, `DOMContentLoaded` wrappers, IIFEs, or manual bootstrap code; Prisma PHP normalizes the script contract for the runtime.
|
|
27
34
|
- Only the root `layout.php` should define `<html>`, `<head>`, and `<body>`. When PulsePoint is present, keep `MainLayout::$children;` and any `<script>` inside one clear wrapper.
|
|
28
35
|
|
|
29
36
|
## Component Boundary Rules
|
|
@@ -31,7 +38,7 @@
|
|
|
31
38
|
- Distinguish PHPX class components from `ImportComponent` partials.
|
|
32
39
|
- `ImportComponent` partials must output exactly one root element because Prisma PHP uses that root as the imported component boundary and serializes props there.
|
|
33
40
|
- Do not manually add `pp-component` inside `ImportComponent` partial source; Prisma PHP injects it there.
|
|
34
|
-
- When imported partials need PulsePoint logic, keep the `<script>` inside that same root element and author it as a plain `<script>` tag without `type="text/pp"
|
|
41
|
+
- When imported partials need PulsePoint logic, keep the `<script>` inside that same root element and author it as a plain `<script>` tag without `type="text/pp"`, DOM-ready wrappers, or manual bootstrap code.
|
|
35
42
|
|
|
36
43
|
## Relevant Docs
|
|
37
44
|
|
package/dist/AGENTS.md
CHANGED
|
@@ -194,6 +194,8 @@ When a task involves package scripts, read `commands.md` first and inspect the c
|
|
|
194
194
|
|
|
195
195
|
For normal full-stack Prisma PHP work, assume the user wants the PulsePoint-first approach unless they explicitly ask otherwise.
|
|
196
196
|
|
|
197
|
+
PulsePoint is the primary JavaScript authoring model for frontend work in Prisma PHP. For normal page behavior, keep the client logic inside a plain inline `<script>` within the route or imported-partial root, let Prisma PHP scope and execute it, and prefer `pp.fetchFunction(...)` over ad hoc endpoints.
|
|
198
|
+
|
|
197
199
|
Default interaction stack:
|
|
198
200
|
|
|
199
201
|
1. render route UI with `index.php`
|
|
@@ -220,6 +222,7 @@ Treat this as the default for:
|
|
|
220
222
|
Do **not** default to:
|
|
221
223
|
|
|
222
224
|
- a PHP-only interaction style
|
|
225
|
+
- plain browser-DOM wiring when PulsePoint state, bindings, and native `on*` handlers already fit the task
|
|
223
226
|
- ad hoc `fetch('/api/...')` patterns
|
|
224
227
|
- extra `route.php` files for page-local interactions that already fit `pp.fetchFunction(...)`
|
|
225
228
|
- a separate Node realtime or tool server when the documented Prisma PHP runtime already fits the task
|
|
@@ -248,6 +251,7 @@ Also follow these route-file rules:
|
|
|
248
251
|
- `index.php` and nested `layout.php` must render a single parent HTML element
|
|
249
252
|
- for normal pages and nested layouts, do **not** manually author `pp-component` on that root; Prisma PHP adds it automatically
|
|
250
253
|
- author a plain `<script>` tag inside that root when PulsePoint logic is needed and do **not** add `type="text/pp"` manually
|
|
254
|
+
- write PulsePoint state, derived values, and functions directly at the top level of that script; do **not** wrap them in `DOMContentLoaded`, an IIFE, manual `pp.mount()` calls, or custom scoping helpers
|
|
251
255
|
- only the root `layout.php` should define `<html>`, `<head>`, and `<body>`
|
|
252
256
|
- when PulsePoint is present in a root `layout.php`, keep `MainLayout::$children` and any `<script>` inside one clear wrapper
|
|
253
257
|
|
|
@@ -302,6 +306,7 @@ Do not:
|
|
|
302
306
|
- put a sibling `<script>` next to a route root or imported partial root
|
|
303
307
|
- manually add `pp-component` inside imported partial source
|
|
304
308
|
- manually add `type="text/pp"` to route or imported-partial scripts
|
|
309
|
+
- wrap imported-partial PulsePoint code in `DOMContentLoaded`, an IIFE, manual `pp.mount()` calls, or custom auto-execute helpers
|
|
305
310
|
|
|
306
311
|
## Metadata rules
|
|
307
312
|
|
|
@@ -567,6 +572,10 @@ When a task involves reactive frontend behavior, read `pulsepoint.md` first.
|
|
|
567
572
|
|
|
568
573
|
Also follow these rules:
|
|
569
574
|
|
|
575
|
+
- treat PulsePoint as the primary JavaScript authoring model for normal full-stack frontend work
|
|
576
|
+
- keep page and imported-partial client logic inside the boundary's plain `<script>` tag instead of building extra DOM-ready or self-executing wrappers
|
|
577
|
+
- prefer `pp.fetchFunction(...)` over ad hoc `fetch('/api/...')` calls for page-local PHP interactions
|
|
578
|
+
- reserve plain browser JavaScript outside PulsePoint for external libraries, low-level browser APIs, and reusable helpers in `ts/`
|
|
570
579
|
- do not invent undocumented PulsePoint helpers or directives
|
|
571
580
|
- do not write React, Vue, Alpine, or Livewire syntax and call it PulsePoint
|
|
572
581
|
- keep backend concerns separate from PulsePoint runtime concerns
|