wcstack 4.0.0-rc.9 → 4.0.1
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.md +6 -2
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,11 +39,11 @@ wcstack is buildless — load what you need from a CDN. The default is one tag p
|
|
|
39
39
|
|
|
40
40
|
Each `/auto` script registers its custom elements and does nothing else. No initialization call, no bootstrap. Tags activate when the browser parses them. The tags fetch in parallel (every `/auto` is self-contained), so multiple tags cost requests, not a waterfall.
|
|
41
41
|
|
|
42
|
-
For an app that uses the SPA core anyway, **this package ships the bundle**: `wcstack/auto` is `@wcstack/state` + `@wcstack/router` + `@wcstack/fetch` + `@wcstack/storage` + `@wcstack/autoloader` pre-linked by Rollup into one self-contained file (
|
|
42
|
+
For an app that uses the SPA core anyway, **this package ships the bundle**: `wcstack/auto` is `@wcstack/state` + `@wcstack/router` + `@wcstack/fetch` + `@wcstack/storage` + `@wcstack/autoloader` pre-linked by Rollup into one self-contained file (218 KB min / 70 KB gzip as of 4.0) — one request, and in production one `integrity` hash covering every line of the core that runs (digests ship with each GitHub Release; see `docs/sri.md`):
|
|
43
43
|
|
|
44
44
|
```html
|
|
45
45
|
<script type="module"
|
|
46
|
-
src="https://cdn.jsdelivr.net/npm/wcstack@
|
|
46
|
+
src="https://cdn.jsdelivr.net/npm/wcstack@4.0.1/dist/auto.min.js"
|
|
47
47
|
integrity="sha384-…"></script>
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -321,6 +321,10 @@ GOOD: <p><!--@@: count--></p> <!-- comment binding: no FOUC, no ext
|
|
|
321
321
|
BAD: <template data-wcs="for: items|take(2)">
|
|
322
322
|
GOOD: <template data-wcs="for: firstTwo"> <!-- get firstTwo() { return this.items.slice(0, 2); } -->
|
|
323
323
|
|
|
324
|
+
<!-- A class binding names its class after the dot (the same for attr.). -->
|
|
325
|
+
BAD: <li data-wcs="class: done"> <!-- sets a "class" property: no class changes -->
|
|
326
|
+
GOOD: <li data-wcs="class.done: done">
|
|
327
|
+
|
|
324
328
|
<!-- In a delegated handler, currentTarget is the root. -->
|
|
325
329
|
BAD: select(event) { event.currentTarget.classList.add("on"); } <!-- with onclick: select -->
|
|
326
330
|
GOOD: select(event) { event.target.closest("li").classList.add("on"); }
|