marionette 5.0.0-beta.2 → 5.0.0-beta.4

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.
Files changed (59) hide show
  1. package/changelog.md +45 -0
  2. package/dist/agent-skill/SKILL.md +62 -76
  3. package/dist/docs/config/api-contracts/inventory.json +166 -168
  4. package/dist/docs/config/api-contracts/semantics.json +127 -46
  5. package/dist/docs/config/diagnostics/catalog.json +3 -1
  6. package/dist/docs/docs/agent-tools.md +48 -1
  7. package/dist/docs/docs/agents.md +59 -29
  8. package/dist/docs/docs/application-agent-template.md +3 -2
  9. package/dist/docs/docs/application-effects.md +151 -0
  10. package/dist/docs/docs/application-refresh.md +180 -0
  11. package/dist/docs/docs/beta.md +19 -12
  12. package/dist/docs/docs/choosing-integrations.md +2 -5
  13. package/dist/docs/docs/common.md +7 -2
  14. package/dist/docs/docs/compact-reference.md +4 -4
  15. package/dist/docs/docs/data.api.md +1 -1
  16. package/dist/docs/docs/events.class.md +28 -44
  17. package/dist/docs/docs/events.md +38 -21
  18. package/dist/docs/docs/installation.md +9 -9
  19. package/dist/docs/docs/marionette.application.md +214 -87
  20. package/dist/docs/docs/marionette.region.md +22 -0
  21. package/dist/docs/docs/marionette.state.md +4 -0
  22. package/dist/docs/docs/migration-from-v4.md +14 -9
  23. package/dist/docs/docs/optional-backbone.md +1 -1
  24. package/dist/docs/docs/radio.md +18 -9
  25. package/dist/docs/docs/readme.md +3 -0
  26. package/dist/docs/docs/routing.md +242 -119
  27. package/dist/docs/docs/terminology.md +3 -3
  28. package/dist/docs/manifest.json +57 -35
  29. package/dist/docs/packages/adapters/readme.md +5 -5
  30. package/dist/docs/packages/data/readme.md +1 -1
  31. package/dist/docs/packages/radio/readme.md +1 -1
  32. package/dist/docs/packages/utils/readme.md +5 -3
  33. package/dist/docs/readme.md +3 -3
  34. package/dist/docs/skills/marionette/SKILL.md +62 -76
  35. package/dist/docs/starter/AGENTS.md +18 -19
  36. package/dist/docs/starter/package.json +5 -5
  37. package/dist/docs/starter/workspace.test.mjs +35 -0
  38. package/dist/docs/starter/workspace.ts +32 -28
  39. package/dist/docs/test/fixtures/docs-application-guides/effects.mjs +222 -0
  40. package/dist/docs/test/fixtures/docs-application-guides/validate.mjs +3 -0
  41. package/dist/docs/test/fixtures/docs-routing/package.json +2 -1
  42. package/dist/docs/test/fixtures/docs-routing/refresh.mjs +274 -0
  43. package/dist/docs/test/fixtures/docs-routing/validate.mjs +46 -1
  44. package/dist/docs/upgradeGuide.md +74 -0
  45. package/dist/eslint/index.cjs +1 -1
  46. package/dist/eslint/index.js +1 -1
  47. package/dist/marionette.cjs +105 -59
  48. package/dist/marionette.cjs.map +1 -1
  49. package/dist/marionette.js +105 -59
  50. package/dist/marionette.js.map +1 -1
  51. package/dist/marionette.min.js +1 -1
  52. package/dist/marionette.min.js.map +1 -1
  53. package/dist/marionette.umd.js +117 -129
  54. package/dist/marionette.umd.js.map +1 -1
  55. package/dist/types/cjs/modules/application.d.ts +16 -6
  56. package/dist/types/esm/modules/application.d.ts +16 -6
  57. package/package.json +12 -11
  58. package/readme.md +4 -3
  59. package/upgradeGuide.md +74 -0
package/changelog.md CHANGED
@@ -1,3 +1,48 @@
1
+ ### v5.0.0-beta.4
2
+
3
+ > Events announce. Preparation waits. Apparently those needed separate job descriptions.
4
+
5
+ * Separate Application preparation from lifecycle notifications. Await
6
+ `prepareStart`, `prepareStop`, and `prepareDestroy`; `onBefore*` hooks and
7
+ `before:*` events are synchronous notifications. Pass `prepareStart`'s resolved
8
+ value unchanged to `onStart` and `start` as the third argument. Migrate async
9
+ `onBefore*` work to the corresponding preparation method.
10
+ * Preserve inferred startup result types for optional preparation methods, including
11
+ `undefined` when the method is absent.
12
+ * Include referenced consumer resources in documentation exports and keep maintainer
13
+ material out of the packaged consumer documentation.
14
+ * Clarify packaged and copied agent-skill helper paths, with executable lookup
15
+ examples checked against the installed documentation.
16
+
17
+ ### v5.0.0-beta.3
18
+
19
+ > Fewer surprise events and surprise startups, because whitespace is not an API and ownership is not a scheduler.
20
+
21
+ * Add `Application#setView(view)` and no-argument `showView()` so an Application
22
+ can compose a complete root View tree before handing it to its Region. `getView()`
23
+ returns the prepared View first and the displayed View after handoff.
24
+ * Make child Application activation explicit. Registration owns teardown without
25
+ starting children; parent restart does not automatically reactivate registered children.
26
+ Successful stop and destruction drain active descendants through stopped owners,
27
+ and descendant `start()` or `restart()` resolves `false` while an ancestor is
28
+ stopping or terminal.
29
+ * Resolve `triggerMethod` lifecycle hooks from instance and prototype methods only;
30
+ constructor-option hooks no longer override or suppress those methods.
31
+ * Treat Events and Radio request names as literal strings across registration,
32
+ dispatch, and removal. Replace whitespace-batched operations with separate calls
33
+ or map entries; object-form event dispatch and the shared `eventSplitter` export
34
+ are removed.
35
+ * Remove View Region registration/removal lifecycle events. Observe a specific
36
+ Region's destruction lifecycle when teardown notification is required.
37
+ * Fix `getOption` so numeric zero and empty-string property keys resolve through
38
+ the normal option-before-instance lookup.
39
+ * Clarify selector-backed versus Element-backed Region placeholder identity after
40
+ a parent render, with public regression coverage for replacement and cleanup.
41
+ * Improve the typed starter's View ownership and missing-field rendering, and add
42
+ consumer-first migration and native/Backbone routing guidance.
43
+ * Add executable Application guidance for explicit effect lifetimes, navigation,
44
+ and latest-request refreshes that preserve active View and row identity.
45
+
1
46
  ### v5.0.0-beta.2
2
47
 
3
48
  > Now with source maps, so “the AI wrote it” is slightly less useful as a debugging strategy.
@@ -1,89 +1,75 @@
1
1
  ---
2
2
  name: marionette
3
- description: Build and debug applications using Marionette v5 with the installed version's documentation, independent integration choices, and lifecycle-aware validation. Use for application work involving Marionette Views, Regions, CollectionViews, Application, state, or adapters; library maintenance follows its own repository instructions.
3
+ description: Build or debug Marionette v5 applications using version-matched docs. For changes to the library itself, use its repository guidance.
4
4
  ---
5
5
 
6
6
  # Build with Marionette
7
7
 
8
- Use the application's installed contract. This skill does not select a package
9
- version, authorize an upgrade, or replace the application's existing decisions.
8
+ Use the application's installed contract and preserve compatible integration
9
+ choices. This skill does not authorize dependency upgrades.
10
10
 
11
- ## Find the contract
11
+ ## Locate matching docs
12
12
 
13
- Inspect the application's manifest, lockfile, and runtime configuration. Resolve
14
- paths relative to the application being edited, including its workspace directory
15
- in a monorepo. Do not use the skill's own directory as the application root.
13
+ Resolve the package from the application workspace, not the copied skill directory
14
+ or a neighboring monorepo package. The read-only helper requires Node 24 or later.
15
+ Its path is `scripts/docs.mjs` relative to the directory containing this `SKILL.md`:
16
16
 
17
- Run the bundled helper with Node 24 or later (replace both absolute paths):
17
+ - In the npm package, that directory is `<package-root>/dist/agent-skill/`.
18
+ - After copying the skill, it is the copied directory, such as
19
+ `/path/to/application/.agents/skills/marionette/`.
20
+
21
+ Replace `/path/to/skill-directory` with that directory's absolute path and
22
+ `/path/to/application` with the application's absolute path. These commands work
23
+ from any working directory:
18
24
 
19
25
  ```sh
20
- node /path/to/marionette/scripts/docs.mjs --project /path/to/application --list
21
- node /path/to/marionette/scripts/docs.mjs --project /path/to/application --page docs/agents.md
26
+ node "/path/to/skill-directory/scripts/docs.mjs" --project "/path/to/application" --list
27
+ node "/path/to/skill-directory/scripts/docs.mjs" --project "/path/to/application" --page docs/agents.md
22
28
  ```
23
29
 
24
- The helper reads files only. It finds the installed `marionette` package without
25
- executing project code, checks the packaged documentation's version and hashes,
26
- and reports provenance. Use its returned paths to read further pages. It does not
27
- search the internet or run a package manager. For an installation without a
28
- `node_modules` tree, supply `--package-root /physical/path/to/marionette` obtained
29
- from that project's package manager. Do not substitute a different workspace's
30
- package just because it is available.
31
-
32
- If the installed artifact has no `dist/docs`, inspect its exports and declarations
33
- and obtain docs from that package's exact release or known source commit. An alpha
34
- version string alone does not establish a source match. Report missing provenance;
35
- do not silently use `master`, current website docs, or another project's package.
36
- A hash check detects inconsistent documentation files, not whether a custom build's
37
- JavaScript actually matches those docs. Validate uncertain behavior against the
38
- installed runtime. A `sourceDirty: true` manifest describes local changes, not an
39
- immutable release.
40
-
41
- ## Read only what the task needs
42
-
43
- Start with packaged `docs/agents.md`, then use these source paths from the manifest:
44
-
45
- - New setup or an integration decision: `docs/installation.md` and
46
- `docs/choosing-integrations.md`.
47
- - UI ownership and replacement: `docs/marionette.view.md`,
48
- `docs/marionette.region.md`, and `docs/view.lifecycle.md`.
49
- - Changing lists: `docs/marionette.collectionview.md` and `docs/data.api.md`.
50
- - Asynchronous features or routing: `docs/marionette.application.md` and
51
- `docs/routing.md`.
52
- - State or a diagnostic: `docs/marionette.state.md` or
53
- `docs/diagnostic-catalog.md`.
54
-
55
- If the client already has the Marionette documentation MCP configured, consult
56
- the `marionette://catalog` resource before searching. Use remote documents only
57
- when version and source match this installation. Pass the exact installed
58
- `version` to every tool and follow `nextOffset` until it is `null` to retrieve the
59
- complete page or example.
60
- Setup instructions: https://marionettejs.com/docs/mcp/. A URL in these instructions
61
- does not install an MCP connection. Keep the installed docs when the catalog is
62
- unsupported or the service is unavailable. Website WebMCP only controls its own
63
- examples, not this application.
64
-
65
- The manifest is the available-page index. Follow direct links for the selected
66
- task instead of loading the whole reference. For v4 work, use matching migration
67
- material and installed APIs; these v5 instructions are not an upgrade plan.
68
-
69
- ## Make the application decision
70
-
71
- Preserve a compatible established integration. For a new application, use built-in
72
- behavior when it supplies the capability; select an observable source when updates
73
- need observation. Choose DataApi, StateApi, renderer, DomApi, EventDelegator, and
74
- router independently. A Backbone router does not require Backbone data or state.
75
- Register configuration before creating its consumers; use an isolated runtime only
76
- when independent configurations must coexist.
77
-
78
- Name the owner and cleanup operation for Views, subscriptions, widgets, and async
79
- work. Use public lifecycle APIs. Check stale work before committing side effects;
80
- framework cancellation cannot undo arbitrary writes by application code. Consult
81
- the current reference for exact return and readiness behavior rather than inferring
82
- it from a method name.
83
-
84
- Use the application's own test commands. Exercise the requested behavior and its
85
- relevant boundary: stale navigation, surviving edits/focus, rerendered event
86
- handlers, or resource cleanup. Browser behavior needs a browser check. Report
87
- commands actually run and untested boundaries; a successful build is not proof of
88
- those interactions. Record changed integration decisions in the application's own
89
- instructions without copying the library's maintainer policy.
30
+ These are lookup options, not a required sequence. `--list` returns provenance and
31
+ available page paths; `--page` reads one source path. The helper checks packaged
32
+ documentation hashes and version without executing project code or using a network.
33
+ For installations without `node_modules`, supply `--package-root` with the physical
34
+ package directory obtained from that application's package manager.
35
+
36
+ If packaged docs are absent, use the exact release or known source commit and
37
+ installed exports/declarations. Do not silently substitute current website docs,
38
+ `master`, or another workspace's package. An alpha version alone does not establish
39
+ source identity; `sourceDirty: true` is not an immutable release. Documentation
40
+ hashes do not prove a custom runtime matches them; test uncertain runtime behavior.
41
+
42
+ ## Select the relevant contract
43
+
44
+ Pass the task page's `source` field from the manifest or `--list` output to
45
+ `--page`. The returned absolute `path` is for reading the file directly:
46
+
47
+ | Task | Packaged page |
48
+ | --- | --- |
49
+ | New application | `docs/development.md` for the typed starter; `docs/choosing-integrations.md` for integration decisions |
50
+ | Migrating an existing application | `docs/agent-tools.md` (pre-migration setup); `docs/migration-from-v4.md` and `upgradeGuide.md` from that target |
51
+ | Application architecture or unfamiliar ownership | `docs/agents.md` |
52
+ | Rendering or screen replacement | `docs/marionette.view.md`, `docs/marionette.region.md`, `docs/view.lifecycle.md` |
53
+ | Changing lists or observable records | `docs/marionette.collectionview.md`, `docs/data.api.md` |
54
+ | Async features or navigation | `docs/marionette.application.md`, `docs/routing.md` |
55
+ | State ownership or framework error | `docs/marionette.state.md` or `docs/diagnostic-catalog.md` |
56
+ | Skill setup or optional documentation MCP | `docs/agent-tools.md` |
57
+
58
+ Follow relevant links rather than loading an overview and every reference. For MCP,
59
+ read the retrieval rules in `docs/agent-tools.md` before remote use: exact version
60
+ and source must match. Installed Markdown remains sufficient. For v4 applications,
61
+ use matching migration material and installed APIs; this skill is not an upgrade plan.
62
+
63
+ DataApi, StateApi, renderer, DomApi, EventDelegator, and router are independent
64
+ choices; a Backbone router does not require Backbone data. Register configuration
65
+ before consumers. Use templates, named Regions, and public lifecycle APIs; domain
66
+ records belong in data sources, not child View traversal. For application design,
67
+ including personalized examples, use `docs/agents.md`.
68
+
69
+ ## Completion
70
+
71
+ The requested application behavior works against the installed package, preserves
72
+ unrelated edits/focus and ownership, and has evidence for the affected interaction
73
+ and cleanup boundary. Use the application's checks; browser interactions require
74
+ browser evidence. Report actual results and untested boundaries. Record changed
75
+ integration decisions in the application's notes, keeping API details in the docs.