Added
cyclewire/streamover a WebSocket.connect()opens a WebSocket for aws:or
wss:URL, with the same sharing, state, back/forward cache and prerendering rules as
Server-Sent Events. Every text message is HTML with<cw-stream>messages, and a socket
that closes without being told to comes back after a growing delay. Instreams(), a
WebSocket channel must be on the page's own origin too.stream.min.jsis 3.8 kB
brotli.- The server helpers (
docs/server-helpers.md) writecyclewire/request's attributes:
get,post,put,patchanddelete(a URL, ortruefor the element's own; one
at most),target,swapandselect, checked and escaped like the others, in PHP,
Ruby, Python and JavaScript.
Fixed
- The lazy listeners of 1.2.0 no longer cost script time on load. The scan that
finds which event types a page binds visited every binding, and while a page was still
parsing, it built its selectors again for every element the parser added. In the
benchmark's 1.2.0 run, the page with the core inlined in<head>spent 62 ms in script
on the phone profile, against 35 ms for 1.1.0 (on a slower machine). The scan now looks
only for bindings of the event types still without a listener, with a selector built
once, which on most pages matches nothing; measured on one machine, script time is
back to 1.1.0's. The core is 5.2 kB brotli.
Changed
- Intent comes from
pointeroverandfocusin. A finger firespointerovertoo, just
beforepointerdown, in Chromium, Firefox and WebKit alike, so thepointerdown
listener only repeated it: a page now has one listener fewer. cw-debounceno longer holds up a submit: it runs at once, and a run still waiting for
the pause is dropped. On a search form withcw-on-inputandcw-debounce, Enter
answers without the delay.cyclewire/request: the newest request for a target wins. A request still on its way
to a target stops when another one sets out for it, from any element, and ends quietly,
so a late answer never covers a newer one.- The performance guide shows how, with a bundler, the action people reach for first
comes in the entry and costs no request of its own;modulepreloadstays the way
without one.
Install
npm install cyclewire@1.3.0<script src="https://cdn.jsdelivr.net/npm/cyclewire@1.3.0/dist/cyclewire.global.min.js"
integrity="sha384-yo42zHgY7Yf6kIyWVDO4ngAU5LHtJIE4xzerMZZ0tkI+cqrp05sb1fpKgNMp7zAk"
crossorigin="anonymous" defer></script>Subresource Integrity
| File | SRI |
|---|---|
cyclewire.global.min.js |
sha384-yo42zHgY7Yf6kIyWVDO4ngAU5LHtJIE4xzerMZZ0tkI+cqrp05sb1fpKgNMp7zAk |
cyclewire.full.global.min.js |
sha384-9oOh1LfU2raS4pWcGBFVO7JpTqRzLMY+qxm6Gz4Fm25NZOLRb5Ve/WmdzTXU7Uzz |
cyclewire.min.js |
sha384-wTGkA6Rp07f8ELyXLeUfPtYAY5yzR3EwylcMST7br9P9QnH2LdAAm2akFlSmMAso |
bootstrap.min.js |
sha384-vj2eX3dMF+H+TAn5EDJLnIQstOgN+3jxEUEERfaP3t/AB2OXKnBNYHTZ3lTFixVZ |
css.min.js |
sha384-cgEWoPjsjiT5QBylzV4uybM+MBrqHBG3MT31zHTrorU1SrzevI/swrudPI7m7A/O |
devtools.min.js |
sha384-3407qOCVSJ1f7DaTKR2d3PR/FKxzN59ZYbRpxjo1dU4SOqjgT2XAqtHx94OFTX/I |
dom.min.js |
sha384-7eTweGJv9TJihgpngwr2XxUnjoW1zwjbQL3t0OB/H3GD70PzrlxG0pMoSteA56cc |
early.min.js |
sha384-bBIpoHFCRqKlBZGNm+Vir5V0mI73L0GEijiYoT/uJKkb5XalHKCdSMn95SoIeHGn |
morph.min.js |
sha384-4aBYsTEuuqpesj+h5Dymz1zEJwzAMaT+DhXLlDrN/+O0Q0RE1PGH3LJ0XtEwF+2g |
prefetch.min.js |
sha384-0ndzcco2IlO4IvLYC0tLp43R8qrnX8s08tDk9YYXXU0/4umdkUcQ8Pcp8cp5ZsPW |
request.min.js |
sha384-WOM2lF2SvtQV3ECHDFR9QMNGmJ+Ms5nnlMe/KGxqGKQMTyxhn7GU5NgmzELq+VrP |
signals.min.js |
sha384-uYGUNGDjYXEpnfY++82FnvHi9a8/IJfXmXExyB8HAj2ITa+0rHnM+3LUbyo1dRZH |
stream.min.js |
sha384-nEbeaNnn9m8DKzr0NX/DjPmB7YAonEBsXSOhG8OVAYDwQJAH2c0s2HUHbNA39g1L |
Full changelog: CHANGELOG.md