haori 0.63.0 → 0.65.0

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Haori.js は、HTML 属性を中心にして動的な UI を実現する軽量なライブラリです。JavaScript をほとんど書かずに、データバインディング、条件分岐、繰り返し処理、フォームの双方向バインディング、サーバー通信などを HTML 属性で宣言できます。
4
4
 
5
- バージョン: 0.63.0
5
+ バージョン: 0.65.0
6
6
 
7
7
  ---
8
8
 
@@ -60,10 +60,11 @@ ES Module:
60
60
  import Haori from 'haori';
61
61
  ```
62
62
 
63
- CSP(Content Security Policy)で `'unsafe-eval'` を許さないページでは、読み込む `<script>` に `data-csp` を書きます(ESM では `Haori.setCsp(true)`)。式を `new Function` を使わずに評価します。推奨する CSP と移行の手順は [仕様書の「Content Security Policy (CSP)」](docs/ja/specs.md#content-security-policy-csp) を参照してください。
63
+ 既定は CSP モードです。式を `new Function` を使わずに評価するため、CSP(Content Security Policy)で `'unsafe-eval'` を許さないページでもそのまま動きます。`data-click-run` などの本文を JavaScript として実行する従来の方式を使う場合は、読み込む `<script>` に `data-csp="false"` を書きます(ESM では `Haori.setCsp(false)`)。従来の方式は `'unsafe-eval'` を必要とします。0.64.0 までは従来の方式が既定でした。推奨する CSP と移行の手順は [仕様書の「Content Security Policy (CSP)」](docs/ja/specs.md#content-security-policy-csp) を参照してください。
64
64
 
65
65
  ```html
66
- <script src="https://cdn.jsdelivr.net/npm/haori/dist/haori.iife.js" data-csp></script>
66
+ <!-- 従来の方式 -->
67
+ <script src="https://cdn.jsdelivr.net/npm/haori/dist/haori.iife.js" data-csp="false"></script>
67
68
  ```
68
69
 
69
70
  ---
@@ -179,7 +180,7 @@ JS からバインドデータを読むには `Haori.Core.getBindingData(element
179
180
 
180
181
  公開運用メモ:
181
182
 
182
- 1. `npm run test`、`npm run build`、`npm pack --dry-run` を実行する
183
+ 1. `npm run test`、`npm run test:legacy`、`npm run build`、`npm pack --dry-run` を実行する
183
184
  2. `npm version patch` などで公開する版数に更新する
184
185
  3. `git push origin main` と `git push origin --tags` を実行する
185
186
  4. 新しい版数タグから GitHub Release を公開する
@@ -198,8 +199,11 @@ npm install
198
199
  ```bash
199
200
  npm run compile
200
201
  npm run test
202
+ npm run test:legacy
201
203
  ```
202
204
 
205
+ `npm run test` は CSP モード(既定)で、`npm run test:legacy` は従来の方式で全単体テストを流します。
206
+
203
207
  3. 配布物のビルド
204
208
 
205
209
  ```bash
@@ -232,6 +236,7 @@ git push origin --tags
232
236
  公開前の推奨確認:
233
237
 
234
238
  - `npm run test`
239
+ - `npm run test:legacy`
235
240
  - `npm run build`
236
241
  - `npm pack --dry-run`
237
242
 
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.63.0
5
+ Version: 0.65.0
6
6
 
7
7
  ---
8
8
 
@@ -60,10 +60,11 @@ ES Module import:
60
60
  import Haori from 'haori';
61
61
  ```
62
62
 
63
- On pages whose Content Security Policy does not allow `'unsafe-eval'`, add `data-csp` to the `<script>` tag (or call `Haori.setCsp(true)` with ES modules). Expressions are then evaluated without `new Function`. See "Content Security Policy (CSP)" in the specification (`docs/ja/specs.md`, Japanese) for the recommended policy and the migration steps.
63
+ The CSP mode is the default. Expressions are evaluated without `new Function`, so Haori works on pages whose Content Security Policy does not allow `'unsafe-eval'`. To use the legacy mode, which runs the bodies of `data-click-run` and similar attributes as JavaScript, add `data-csp="false"` to the `<script>` tag (or call `Haori.setCsp(false)` with ES modules). The legacy mode requires `'unsafe-eval'`. Up to 0.64.0, the legacy mode was the default. See "Content Security Policy (CSP)" in the specification (`docs/ja/specs.md`, Japanese) for the recommended policy and the migration steps.
64
64
 
65
65
  ```html
66
- <script src="https://cdn.jsdelivr.net/npm/haori/dist/haori.iife.js" data-csp></script>
66
+ <!-- Legacy mode -->
67
+ <script src="https://cdn.jsdelivr.net/npm/haori/dist/haori.iife.js" data-csp="false"></script>
67
68
  ```
68
69
 
69
70
  ---
@@ -181,7 +182,7 @@ Basic local verification and release preparation steps:
181
182
 
182
183
  Quick release memo:
183
184
 
184
- 1. Run `npm run test`, `npm run build`, and `npm pack --dry-run`.
185
+ 1. Run `npm run test`, `npm run test:legacy`, `npm run build`, and `npm pack --dry-run`.
185
186
  2. Bump the package version with `npm version patch` or the intended version command.
186
187
  3. Push `main` and tags with `git push origin main` and `git push origin --tags`.
187
188
  4. Publish a GitHub Release from the new version tag.
@@ -200,8 +201,11 @@ npm install
200
201
  ```bash
201
202
  npm run compile
202
203
  npm run test
204
+ npm run test:legacy
203
205
  ```
204
206
 
207
+ `npm run test` runs all unit tests in the CSP mode (the default), and `npm run test:legacy` runs them in the legacy mode.
208
+
205
209
  3. Build release artifacts
206
210
 
207
211
  ```bash
@@ -234,6 +238,7 @@ Required repository setup:
234
238
  Recommended pre-release checks:
235
239
 
236
240
  - `npm run test`
241
+ - `npm run test:legacy`
237
242
  - `npm run build`
238
243
  - `npm pack --dry-run`
239
244