haori 0.44.1 → 0.45.2
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.
- package/README.ja.md +8 -5
- package/README.md +8 -5
- package/dist/haori.cjs.js +17 -17
- package/dist/haori.es.js +1530 -1130
- package/dist/haori.iife.js +17 -17
- package/dist/index.d.ts +83 -1
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Haori.js は、HTML 属性を中心にして動的な UI を実現する軽量なライブラリです。JavaScript をほとんど書かずに、データバインディング、条件分岐、繰り返し処理、フォームの双方向バインディング、サーバー通信などを HTML 属性で宣言できます。
|
|
4
4
|
|
|
5
|
-
バージョン: 0.
|
|
5
|
+
バージョン: 0.45.2
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -150,7 +150,9 @@ JS からバインドデータを読むには `Haori.Core.getBindingData(element
|
|
|
150
150
|
|
|
151
151
|
> **セキュリティの前提**: 式のテキストは**開発者が書くコード**です。上記の遮断は事故を難しくする多層防御であり、悪意ある式を防ぐ境界ではありません(式は最終的に `new Function` で評価されます)。**利用者入力や API 応答を式のテキストへ差し込まないでください。** HTML エスケープは式のエスケープではありません(`'` は属性値を読む時点で `'` に戻るため、文字列リテラルの外へ出られます)。信頼できない値は `data-bind` の**値**として渡し、式からはキーで参照してください。詳細は [docs/ja/specs.md](docs/ja/specs.md) の「XSS対策」を参照してください。
|
|
152
152
|
|
|
153
|
-
テスト・デバッグ補助: `waitForRenders()`(`Haori.waitForRenders()` でも可)は、初期化・進行中のフェッチ・キューに積まれた描画タスクがすべて落ち着くまで待機します(E2E テストで描画完了を待つのに便利)。`Haori.Core.dumpScope(element)` は要素に解決されるスコープ(`resolved`)と各キーの由来(`sources
|
|
153
|
+
テスト・デバッグ補助: `waitForRenders()`(`Haori.waitForRenders()` でも可)は、初期化・進行中のフェッチ・キューに積まれた描画タスクがすべて落ち着くまで待機します(E2E テストで描画完了を待つのに便利)。`Haori.Core.dumpScope(element)` は要素に解決されるスコープ(`resolved`)と各キーの由来(`sources`)を返します。開発モードでは、`data-if` が非表示へ切り替わった時点で、その式と参照スコープを自動でログ出力します(非表示のまま再描画しても再出力しません)。式評価の所要時間は `window.__HAORI_EVALUATION_PROFILE__.start()` で集計を開始し、`snapshot()` で取得します(開始するまで集計しません)。
|
|
154
|
+
|
|
155
|
+
開発モードは `<script src="haori.js" data-dev>` で強制でき、**ローカルホストでは既定で有効**です。開発モードの診断は再描画のコストに乗るため、ローカルで本番相当の性能を測る場合は `data-dev="false"` を指定して無効化してください。
|
|
154
156
|
|
|
155
157
|
`data-fetch` と `data-import` は、バインディング更新時に評価結果が変化した場合のみ自動で再評価されます。`data-fetch` は評価後の URL、HTTP メソッド、ヘッダー、body を含む実行シグネチャで比較し、`data-import` は評価後 URL で比較します。これらの属性値に未解決参照が 1 つでも含まれる場合、その時点では実行されず、後続のバインディング更新で参照が解決したときに初めて実行対象になります。
|
|
156
158
|
|
|
@@ -172,7 +174,7 @@ JS からバインドデータを読むには `Haori.Core.getBindingData(element
|
|
|
172
174
|
4. 新しい版数タグから GitHub Release を公開する
|
|
173
175
|
5. npm、jsDelivr、GitHub Release の assets が新しい版数を指すことを確認する
|
|
174
176
|
|
|
175
|
-
GitHub Release 起点で npm publish する workflow
|
|
177
|
+
GitHub Release 起点で npm publish する workflow は、npm の Trusted Publishing(OIDC)で認証します。長期トークンは使いません。npm のパッケージ設定で、この repository と `publish-on-release.yml` からの公開を Trusted Publisher として登録しておいてください。登録が無いと `npm publish` が認証エラーで失敗します。
|
|
176
178
|
|
|
177
179
|
6. 依存インストール
|
|
178
180
|
|
|
@@ -208,11 +210,12 @@ git push origin --tags
|
|
|
208
210
|
|
|
209
211
|
6. 新しいタグから GitHub Release を公開
|
|
210
212
|
|
|
211
|
-
このリポジトリの npm 公開は GitHub Actions で行います。現在の workflow は `release.published` を契機に起動し、パッケージをビルドしたうえで、対象 version が未公開のときだけ
|
|
213
|
+
このリポジトリの npm 公開は GitHub Actions で行います。現在の workflow は `release.published` を契機に起動し、パッケージをビルドしたうえで、対象 version が未公開のときだけ npm へ公開し、あわせて `dist.zip` を GitHub Release のアセットとして添付します。認証は npm の Trusted Publishing(OIDC)で行い、出自証明(provenance)が自動で付きます。
|
|
212
214
|
|
|
213
215
|
必要な前提条件:
|
|
214
216
|
|
|
215
|
-
-
|
|
217
|
+
- npm のパッケージ設定で、この repository と `publish-on-release.yml` が Trusted Publisher として登録されていること
|
|
218
|
+
- 公開ジョブに `id-token: write` の権限があること(OIDC トークンの発行に必要)
|
|
216
219
|
- 対象バージョンのタグから Release を `published` 状態で公開すること
|
|
217
220
|
|
|
218
221
|
公開前の推奨確認:
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Haori.js is a lightweight, HTML-first UI library that enables dynamic user interfaces primarily through HTML attributes. It lets you declare data bindings, conditional rendering, list rendering, form two-way binding, server fetches, and HTML imports without writing much JavaScript.
|
|
4
4
|
|
|
5
|
-
Version: 0.
|
|
5
|
+
Version: 0.45.2
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -152,7 +152,9 @@ Template expressions support JavaScript-like syntax such as property access, bra
|
|
|
152
152
|
|
|
153
153
|
> **Security model:** expression text is **code you write**. The blocks above are defense in depth that make accidents harder, not a boundary against malicious expressions (expressions are ultimately evaluated with `new Function`). **Never interpolate user input or API responses into expression text.** HTML escaping is not expression escaping — `'` turns back into `'` when the attribute value is parsed, which escapes the string literal. Pass untrusted data as `data-bind` **values** and reference it by key from expressions. See "XSS対策" in [docs/ja/specs.md](docs/ja/specs.md) for details.
|
|
154
154
|
|
|
155
|
-
Helpers for tests and debugging: `waitForRenders()` (also `Haori.waitForRenders()`) resolves once initialization, in-flight fetches, and queued render tasks have all settled — useful for E2E tests. `Haori.Core.dumpScope(element)` returns the scope resolved for an element (`resolved`) and where each key comes from (`sources`); in dev mode a
|
|
155
|
+
Helpers for tests and debugging: `waitForRenders()` (also `Haori.waitForRenders()`) resolves once initialization, in-flight fetches, and queued render tasks have all settled — useful for E2E tests. `Haori.Core.dumpScope(element)` returns the scope resolved for an element (`resolved`) and where each key comes from (`sources`); in dev mode a `data-if` logs its expression and referenced scope when it turns hidden (it is not logged again while it stays hidden). Expression timings are collected only after `window.__HAORI_EVALUATION_PROFILE__.start()`; read them with `snapshot()`.
|
|
156
|
+
|
|
157
|
+
Dev mode can be forced with `<script src="haori.js" data-dev>` and is **enabled by default on localhost**. Its diagnostics add to render cost, so pass `data-dev="false"` when measuring production-like performance locally.
|
|
156
158
|
|
|
157
159
|
`data-fetch` and `data-import` are automatically re-evaluated only when their evaluated values change after a binding update. `data-fetch` compares a request signature composed of the resolved URL, HTTP method, headers, and body, while `data-import` compares only the resolved URL. If either attribute contains even one unresolved reference, it is treated as invalid for that evaluation cycle, is not executed, and becomes executable only after a later binding update resolves the reference.
|
|
158
160
|
|
|
@@ -174,7 +176,7 @@ Quick release memo:
|
|
|
174
176
|
4. Publish a GitHub Release from the new version tag.
|
|
175
177
|
5. Confirm npm, jsDelivr, and the GitHub Release assets reflect the new version.
|
|
176
178
|
|
|
177
|
-
|
|
179
|
+
The GitHub Release-driven npm publish workflow authenticates with npm trusted publishing (OIDC), so no long-lived token is used. Register this repository and `publish-on-release.yml` as a trusted publisher in the npm package settings; without that registration, `npm publish` fails with an authentication error.
|
|
178
180
|
|
|
179
181
|
6. Install dependencies
|
|
180
182
|
|
|
@@ -210,11 +212,12 @@ git push origin --tags
|
|
|
210
212
|
|
|
211
213
|
6. Publish a GitHub Release from the new tag
|
|
212
214
|
|
|
213
|
-
Publishing to npm is handled by GitHub Actions when a GitHub Release is published. This repository uses release workflows that trigger on `release.published`, build the package, publish it to npm
|
|
215
|
+
Publishing to npm is handled by GitHub Actions when a GitHub Release is published. This repository uses release workflows that trigger on `release.published`, build the package, publish it to npm if that package version is not already published, and upload `dist.zip` to the release assets. Authentication uses npm trusted publishing (OIDC), which also attaches provenance automatically.
|
|
214
216
|
|
|
215
217
|
Required repository setup:
|
|
216
218
|
|
|
217
|
-
- `
|
|
219
|
+
- This repository and `publish-on-release.yml` must be registered as a trusted publisher in the npm package settings.
|
|
220
|
+
- The publish job must have the `id-token: write` permission so it can request an OIDC token.
|
|
218
221
|
- The release must be published from the target version tag.
|
|
219
222
|
|
|
220
223
|
Recommended pre-release checks:
|