- Feb 2023
-
github.com github.com
-
js const wss = new WebSocketStream(url); const { readable } = await wss.connection; const reader = readable.getReader(); while (true) { const { value, done } = await reader.read(); if (done) break; await process(value); } done();
js const wss = new WebSocketStream(url); const { writable } = await wss.connection; const writer = writable.getWriter(); for await (const message of messages) { await writer.write(message); }
js const controller = new AbortController(); const wss = new WebSocketStream(url, { signal: controller.signal }); setTimeout(() => controller.abort(), 1000);
-
-
docs.google.com docs.google.com
-
Tags
Annotators
URL
-
-
developer.chrome.com developer.chrome.com
-
```js const supportsRequestStreams = (() => { let duplexAccessed = false;
const hasContentType = new Request('', { body: new ReadableStream(), method: 'POST', get duplex() { duplexAccessed = true; return 'half'; }, }).headers.has('Content-Type');
return duplexAccessed && !hasContentType; })();
if (supportsRequestStreams) { // … } else { // … } ```
Tags
Annotators
URL
-
-
ndjson.org ndjson.orgndjson1
Tags
Annotators
URL
-
-
deanhume.com deanhume.com
-
```js /* * Fetch and process the stream / async function process() { // Retrieve NDJSON from the server const response = await fetch('http://localhost:3000/request');
const results = response.body // From bytes to text: .pipeThrough(new TextDecoderStream()) // Buffer until newlines: .pipeThrough(splitStream('\n')) // Parse chunks as JSON: .pipeThrough(parseJSON());
// Loop through the results and write to the DOM writeToDOM(results.getReader()); }
/* * Read through the results and write to the DOM * @param {object} reader / function writeToDOM(reader) { reader.read().then(({ value, done }) => { if (done) { console.log("The stream was already closed!");
} else { // Build up the values let result = document.createElement('div'); result.innerHTML = `<div>ID: ${value.id} - Phone: ${value.phone} - Result: $ {value.result}</div><br>`; // Prepend to the target targetDiv.insertBefore(result, targetDiv.firstChild); // Recursively call writeToDOM(reader); }
}, e => console.error("The stream became errored and cannot be read from!", e) ); } ```
Tags
Annotators
URL
-
-
mxstbr.com mxstbr.com
Tags
Annotators
URL
-
-
www.joshwcomeau.com www.joshwcomeau.com
Tags
Annotators
URL
-
-
www.imdb.com www.imdb.com
-
www.tzi.de www.tzi.de
-
cddl.anweiss.tech cddl.anweiss.tech
-
-
www.bortzmeyer.org www.bortzmeyer.org
Tags
Annotators
URL
-
-
datatracker.ietf.org datatracker.ietf.org
Tags
Annotators
URL
-
-
esc.gsfc.nasa.gov esc.gsfc.nasa.gov
-
esc.gsfc.nasa.gov esc.gsfc.nasa.gov
Tags
Annotators
URL
-
-
www.esa.int www.esa.int
-
marcoghiani.com marcoghiani.com
-
-
Node.js
js import { renderToPipeableStream } from "react-dom/server.node"; import React from "react"; import http from "http"; const App = () => ( <html> <body> <h1>Hello World</h1> <p>This is an example.</p> </body> </html> ); var didError = false; http .createServer(function (req, res) { const stream = renderToPipeableStream(<App />, { onShellReady() { res.statusCode = didError ? 500 : 200; res.setHeader("Content-type", "text/html"); res.setHeader("Cache-Control", "no-transform"); stream.pipe(res); }, onShellError(error) { res.statusCode = 500; res.send( '<!doctype html><p>Loading...</p><script src="clientrender.js"></script>', ); }, onAllReady() { }, onError(err) { didError = true; console.error(err); }, }); }) .listen(3000);
Deno
```js import { renderToReadableStream } from "https://esm.run/react-dom/server"; import * as React from "https://esm.run/react";
const App = () => ( <html> <body>
Hello World
This is an example.
</body> </html> );const headers = { headers: { "Content-Type": "text/html", "Cache-Control": "no-transform", }, };
Deno.serve( async (req) => { return new Response(await renderToReadableStream(<App />), headers); }, { port: 3000 }, ); ```
Bun
```js import { renderToReadableStream } from "react-dom/server"; const headers = { headers: { "Content-Type": "text/html", }, };
const App = () => ( <html> <body>
Hello World
This is an example.
</body> </html> );Bun.serve({ port: 3000, async fetch(req) { return new Response(await renderToReadableStream(<App />), headers); }, }); ```
-
-
scali.com.fr scali.com.fr
Tags
Annotators
URL
-
-
chrome.google.com chrome.google.com
-
docs.sourcegraph.com docs.sourcegraph.com
Tags
Annotators
URL
-
-
sourcegraph.com sourcegraph.com
Tags
Annotators
URL
-
-
beta.reactjs.org beta.reactjs.org
-
beta.reactjs.org beta.reactjs.org
-
nodejs.org nodejs.org
-
-
www.youtube.com www.youtube.com
-
-
blog.logrocket.com blog.logrocket.com
-
prateeksurana.me prateeksurana.me
-
tom-sherman.com tom-sherman.com
-
www.youtube.com www.youtube.com
-
-
www.youtube.com www.youtube.com
-
-
reactjs.org reactjs.org
Tags
Annotators
URL
-
-
beta.reactjs.org beta.reactjs.org
Tags
Annotators
URL
-
-
suspense.vercel.app suspense.vercel.app
-
suspense.vercel.app suspense.vercel.app
Tags
Annotators
URL
-
-
suspense-npm.vercel.app suspense-npm.vercel.app
-
suspense-npm.vercel.app suspense-npm.vercel.app
Tags
Annotators
URL
-
-
soundcloud.com soundcloud.com
-
jsonpath.com jsonpath.com
-
-
jsonpathfinder.com jsonpathfinder.com
-
-
goessner.net goessner.net
-
<table><tbody><tr class="evn"><td> XPath </td><td> JSONPath </td><td> Description </td></tr> <tr class="odd"><td> / </td><td> $ </td><td class="lft">the root object/element </td></tr> <tr class="evn"><td> . </td><td> @ </td><td class="lft">the current object/element </td></tr> <tr class="odd"><td> / </td><td> . or [] </td><td class="lft">child operator </td></tr> <tr class="evn"><td> .. </td><td> n/a </td><td class="lft">parent operator </td></tr> <tr class="odd"><td> // </td><td> .. </td><td class="lft">recursive descent. JSONPath borrows this syntax from E4X. </td></tr> <tr class="evn"><td> * </td><td> * </td><td class="lft">wildcard. All objects/elements regardless their names. </td></tr> <tr class="odd"><td> @ </td><td> n/a </td><td class="lft">attribute access. JSON structures don't have attributes. </td></tr> <tr class="evn"><td> [] </td><td> [] </td><td class="lft">subscript operator. XPath uses it to iterate over element collections and for predicates. In Javascript and JSON it is the native array operator. </td></tr> <tr class="odd"><td> | </td><td> [,] </td><td class="lft">Union operator in XPath results in a combination of node sets. JSONPath allows alternate names or array indices as a set. </td></tr> <tr class="evn"><td> n/a </td><td> [start:end:step] </td><td class="lft">array slice operator borrowed from ES4. </td></tr> <tr class="odd"><td> [] </td><td> ?() </td><td class="lft">applies a filter (script) expression. </td></tr> <tr class="evn"><td> n/a </td><td> () </td><td class="lft">script expression, using the underlying script engine. </td></tr> <tr class="odd"><td> () </td><td> n/a </td><td class="lft">grouping in Xpath </td></tr></tbody></table>
Tags
Annotators
URL
-
-
www.baeldung.com www.baeldung.com
Tags
Annotators
URL
-
-
Tags
Annotators
URL
-
-
Tags
Annotators
URL
-
-
www.dandoescode.com www.dandoescode.com
Tags
Annotators
URL
-
-
jojozhuang.github.io jojozhuang.github.io
-
soundcloud.com soundcloud.com
-
dillonshook.com dillonshook.com
Tags
Annotators
URL
-
-
www.reddit.com www.reddit.com
-
news.ycombinator.com news.ycombinator.com
-
-
beta.reactjs.org beta.reactjs.org
-
legacy.reactjs.org legacy.reactjs.org
-
developers.cloudflare.com developers.cloudflare.com
-
www.loom.com www.loom.com
-
medium.com medium.com
-
citation.crosscite.org citation.crosscite.org
Tags
Annotators
URL
-
-
webcontainers.io webcontainers.io
Tags
Annotators
URL
-
-
fr.wikisource.org fr.wikisource.org
-
gallica.bnf.fr gallica.bnf.fr
-
ogzhanolguncu.com ogzhanolguncu.com
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
javascript.info javascript.info
-
-
-
-
gomakethings.com gomakethings.com
-
bugzilla.mozilla.org bugzilla.mozilla.org
Tags
Annotators
URL
-
-
www.measurethat.net www.measurethat.net
-
dev.to dev.to
-
If you search on the internet about, performances of proxy, some people say that it's a tool for development and should not be used in production
Tags
Annotators
URL
-
-
levelup.gitconnected.com levelup.gitconnected.com
-
developer.mozilla.org developer.mozilla.orgProxy1
-
soundcloud.com soundcloud.com
-
preactjs.com preactjs.com
-
preactjs.com preactjs.com
Tags
Annotators
URL
-
-
twitter.com twitter.com
-
www.builder.io www.builder.io
-
-
-
soundcloud.com soundcloud.com
-
sandpack.codesandbox.io sandpack.codesandbox.io
Tags
Annotators
URL
-
-
Tags
Annotators
URL
-
-
codesandbox.io codesandbox.io
Tags
Annotators
URL
-
-
tunebat.com tunebat.com
-
-
twitter.com twitter.com
Tags
Annotators
URL
-
-
perf.builder.io perf.builder.ioPerflink1
-
-
www.youtube.com www.youtube.com
-
qwik.builder.io qwik.builder.io
-
-
developers.cloudflare.com developers.cloudflare.com
-
blog.cloudflare.com blog.cloudflare.com
-
-
I resolved this by changing the imports from @remix-run/node to @remix-run/cloudflare
diff - import { json } from "@remix-run/node"; + import { json } from "@remix-run/cloudflare";
-
-
github.com github.com
-
Tags
Annotators
URL
-
-
www.cs.man.ac.uk www.cs.man.ac.uk
-
-
www.garshol.priv.no www.garshol.priv.no
Tags
Annotators
URL
-
-
www.iso.org www.iso.org
-
-
www.youtube.com www.youtube.com
Tags
Annotators
URL
-
-
www.youtube.com www.youtube.com
Tags
Annotators
URL
-
-
platform.openai.com platform.openai.com
-
openai.com openai.com
-
www.isan.ca www.isan.ca
Tags
Annotators
URL
-
-
www.isan.org www.isan.org
Tags
Annotators
URL
-
-
datatracker.ietf.org datatracker.ietf.org
-
n2t.net n2t.net
-
-
arks.org arks.org
-
-
archives.paris.fr archives.paris.fr
-
-
stateless.co stateless.co
-
remix.run remix.run
Tags
Annotators
URL
-
-
patrickbrosset.medium.com patrickbrosset.medium.com
-
-
-
punits.dev punits.dev
-
developers.cloudflare.com developers.cloudflare.com
-
developers.cloudflare.com developers.cloudflare.com
-
remix.run remix.run
Tags
Annotators
URL
-
-
www.asteriskdocs.org www.asteriskdocs.org
-
datatracker.ietf.org datatracker.ietf.org
-
vocab.linkeddata.es vocab.linkeddata.es
Tags
Annotators
URL
-
-
codepen.io codepen.io
Tags
Annotators
URL
-
-
codepen.io codepen.io
-
-
storybook.js.org storybook.js.org
Tags
Annotators
URL
-
-
storybook.js.org storybook.js.org
-
You may opt-out of the telemetry by setting Storybook's configuration element disableTelemetry to true, using the --disable-telemetry flag, or setting the environment variableSTORYBOOK_DISABLE_TELEMETRY to 1.
-
-
egghead.io egghead.io
Tags
Annotators
URL
-
-
console.re console.re
-
-
hypothes.is hypothes.is
-
-
svelte.dev svelte.devSvelte1
-
-
webpack.js.org webpack.js.org
-
-
react-typescript-cheatsheet.netlify.app react-typescript-cheatsheet.netlify.app
Tags
Annotators
URL
-
-
www.typescriptlang.org www.typescriptlang.org
Tags
Annotators
URL
-
-
www.code-snippets.dev www.code-snippets.dev
-
-
remix.run remix.run
Tags
Annotators
URL
-
-
www.typescriptlang.org www.typescriptlang.org
Tags
Annotators
URL
-
-
datatracker.ietf.org datatracker.ietf.org
-
www.grammaticalframework.org www.grammaticalframework.org
Tags
Annotators
URL
-
-
bnfc.digitalgrammars.com bnfc.digitalgrammars.com
-