@itrocks/handbook 0.0.11 → 0.0.12

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.
@@ -4,7 +4,9 @@ Register independent DOM enhancements by selector with `build()`; use `HasPlugin
4
4
  extensions around a stable host API.
5
5
 
6
6
  `build()` handles matching elements in `document.body` and later insertions; it can also register prioritised listeners.
7
- Put registrations in an explicit browser build module imported by the browser entry or a template dependency.
7
+ Put template-specific registrations in an explicit browser build module declared in the owning template's head.
8
+ Follow [HTML templates and asset loading](html-templates-and-targets.md#fragments-and-assets);
9
+ reserve browser-entry imports for shared infrastructure or necessary host context detection.
8
10
  Use semantic selectors and guard repeated activation when components do not already do so.
9
11
  Load heavy or optional behaviour inside the callback. Browser subpath imports use explicit `.js` extensions.
10
12
  Keep structure in HTML, behaviour in TypeScript and visual state in SCSS, sharing documented classes and attributes.
@@ -3,6 +3,19 @@
3
3
  Render valid standalone HTML and identify the fragment for asynchronous navigation.
4
4
  The action prepares a small named data context and owns business decisions.
5
5
 
6
+ ## Authoring and validation
7
+
8
+ Author page and fragment markup in HTML templates. Server actions prepare data; browser code enhances the rendered DOM.
9
+ Do not assemble view markup in TypeScript strings or construct entire views with DOM creation calls.
10
+
11
+ The rendered standalone document and the DOM after fragment insertion must pass the
12
+ [W3C Nu HTML Checker](https://validator.w3.org/nu/). Validate rendered output, with template expressions resolved,
13
+ including conditional branches and representative dynamic values. Check source templates for valid HTML structure too.
14
+ Use standard HTML and permitted ARIA attributes; application-specific metadata belongs in `data-*` attributes.
15
+ Do not invent bare attributes or rely on the browser silently repairing invalid nesting.
16
+ Context-dependent composite fragments can be enclosed in a `<template>` outside `BEGIN`/`END` to keep their standalone
17
+ document valid without inserting that wrapper into the live DOM.
18
+
6
19
  ## Expressions
7
20
 
8
21
  - `{property.path}` reads a path; a non-class function is called on its owner.
@@ -28,6 +41,14 @@ Keep language, title and required assets in the full document. Client navigation
28
41
  head styles/scripts without duplicating URLs. Includes retain asset dependencies; relative links become application
29
42
  paths, with `node_modules/@itrocks` served as `/@itrocks/...` and other dependencies as `/lib/...`.
30
43
 
44
+ Declare template-specific CSS with `<link rel="stylesheet">` and JavaScript with `<script type="module" src="...">`
45
+ in that template's `<head>`, outside `BEGIN`/`END` when appropriate. These fragment markers do not prevent the framework
46
+ from processing the head: `xtarget` loads the declared assets when the HTML is first used and avoids duplicates.
47
+ Prefer these declarations over application-wide imports or script-driven asset loading.
48
+ Keep only shared application infrastructure and necessary context detection in the application entry.
49
+ When no HTML template owns an optional integration, load it at the relevant context and document why it is needed.
50
+ Framework adapters belong to the framework; importing a reusable package must not implicitly bind it to the framework.
51
+
31
52
  Match block delimiters exactly. Keep selectors, attributes and action names consistent with browser and SCSS contracts.
32
53
  Verify direct navigation and fragment insertion.
33
54
 
@@ -6,6 +6,8 @@ then the owning package's README for the feature being used.
6
6
  Read only the conventions needed by the task:
7
7
 
8
8
  - Application source: [coding conventions](coding-conventions.md).
9
+ - HTML, fragments and front-end assets:
10
+ [templates and targets](../framework-changes/architecture/html-templates-and-targets.md).
9
11
  - Markdown: [documentation conventions](../framework-changes/documentation/markdown.md).
10
12
  - Framework extension or integration: select the relevant [architecture
11
13
  guide](../framework-changes/architecture/README.md).
package/package.json CHANGED
@@ -25,5 +25,5 @@
25
25
  "type": "git",
26
26
  "url": "git+https://github.com/itrocks-ts/handbook.git"
27
27
  },
28
- "version": "0.0.11"
28
+ "version": "0.0.12"
29
29
  }