- Oct 2024
-
www.carnegie.org www.carnegie.org
-
beyond our power to alter, and therefore to be accepted and made the best of. It is a waste of time to criticize the inevitable.
for - quote / critique - it is upon us, beyond our power to alter, and therefore to be accepted and made the best of. It is a waste of time to criticize the inevitable. - Andrew Carnegie - The Gospel of Wealth - alternatives - to - mainstream companies - cooperatives - Peer to Peer - Decentralized Autonomous Organization (DAO) - Fair Share Commons - B Corporations - Worker owned companies
quote / critique - it is upon us, beyond our power to alter, and therefore to be accepted and made the best of. It is a waste of time to criticize the inevitable. - Andrew Carnegie - The Gospel of Wealth - This is a defeatist attitude that does not look for a condition where both enormous inequality AND universal squalor can both eliminated - Today, there are a growing number of alternative ideas which can challenge this claim such as: - Cooperatives - example - Mondragon corporation with 70,000 employees - B Corporations - Fair Share Commons - Peer to Peer - Worker owned companies - Cosmolocal organizations - Decentralized Autonomous Organization (DAO)
Tags
- alternatives - to - mainstream companies - cooperatives - Peer to Peer - Decentralized Autonomous Organization (DAO) - Fair Share Commons - B Corporations - Worker owned companies
- quote / critique - it is upon us, beyond our power to alter, and therefore to be accepted and made the best of. It is a waste of time to criticize the inevitable. - Andrew Carnegie - The Gospel of Wealth
Annotators
URL
-
- May 2024
-
pages.rvshare.com pages.rvshare.com
-
RVshare’s 2023 Travel Trend Report predicts another blockbuster year for travel. According to new research conducted by Wakefield Research, nearly all Americans (99%) are planning leisure travel in 2023. The RV travel boom continues to press on with 61% planning to take a road trip or vacation in an RV. Travelers are still seeking relaxation and time with family and friends, and work flexibility continues to evolve and become a more permanent lifestyle for many Americans, ultimately affecting their travel decisions
-
- Sep 2023
-
chromestatus.com chromestatus.com
-
gist.github.com gist.github.com
-
-
permit streams to be transferred between workers, frames and anywhere else that postMessage() can be used. Chunks can be anything which is cloneable by postMessage(). Initially chunks enqueued in such a stream will always be cloned, ie. all data will be copied. Future work will extend the Streams APIs to support transferring objects (ie. zero copy).
js const rs = new ReadableStream({ start(controller) { controller.enqueue('hello'); } }); const w = new Worker('worker.js'); w.postMessage(rs, [rs]);
js onmessage = async (evt) => { const rs = evt.data; const reader = rs.getReader(); const {value, done} = await reader.read(); console.log(value); // logs 'hello'. };
-
- Jul 2023
-
developer.chrome.com developer.chrome.com
-
html <meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width"> ... <picture> <!-- serve WebP to Chrome and Opera --> <source media="(min-width: 50em)" sizes="50vw" srcset="/image/thing-200.webp 200w, /image/thing-400.webp 400w, /image/thing-800.webp 800w, /image/thing-1200.webp 1200w, /image/thing-1600.webp 1600w, /image/thing-2000.webp 2000w" type="image/webp"> <source sizes="(min-width: 30em) 100vw" srcset="/image/thing-crop-200.webp 200w, /image/thing-crop-400.webp 400w, /image/thing-crop-800.webp 800w, /image/thing-crop-1200.webp 1200w, /image/thing-crop-1600.webp 1600w, /image/thing-crop-2000.webp 2000w" type="image/webp"> <!-- serve JPEGXR to Edge --> <source media="(min-width: 50em)" sizes="50vw" srcset="/image/thing-200.jpgxr 200w, /image/thing-400.jpgxr 400w, /image/thing-800.jpgxr 800w, /image/thing-1200.jpgxr 1200w, /image/thing-1600.jpgxr 1600w, /image/thing-2000.jpgxr 2000w" type="image/vnd.ms-photo"> <source sizes="(min-width: 30em) 100vw" srcset="/image/thing-crop-200.jpgxr 200w, /image/thing-crop-400.jpgxr 400w, /image/thing-crop-800.jpgxr 800w, /image/thing-crop-1200.jpgxr 1200w, /image/thing-crop-1600.jpgxr 1600w, /image/thing-crop-2000.jpgxr 2000w" type="image/vnd.ms-photo"> <!-- serve JPEG to others --> <source media="(min-width: 50em)" sizes="50vw" srcset="/image/thing-200.jpg 200w, /image/thing-400.jpg 400w, /image/thing-800.jpg 800w, /image/thing-1200.jpg 1200w, /image/thing-1600.jpg 1600w, /image/thing-2000.jpg 2000w"> <source sizes="(min-width: 30em) 100vw" srcset="/image/thing-crop-200.jpg 200w, /image/thing-crop-400.jpg 400w, /image/thing-crop-800.jpg 800w, /image/thing-crop-1200.jpg 1200w, /image/thing-crop-1600.jpg 1600w, /image/thing-crop-2000.jpg 2000w"> <!-- fallback for browsers that don't support picture --> <img src="/image/thing.jpg" width="50%"> </picture>
-
-
blog.logrocket.com blog.logrocket.com
-
pwa-workshop.js.org pwa-workshop.js.org
-
-
developer.mozilla.org developer.mozilla.org
- Jun 2023
-
developer.chrome.com developer.chrome.com
-
Tags
Annotators
URL
-
-
sergiodxa.com sergiodxa.com
-
-
```js /* * Response from cache / self.addEventListener('fetch', event => { const response = self.caches.open('example') .then(caches => caches.match(event.request)) .then(response => response || fetch(event.request));
event.respondWith(response); });
/* * Response to SSE by text / self.addEventListener('fetch', event => { const { headers } = event.request; const isSSERequest = headers.get('Accept') === 'text/event-stream';
if (!isSSERequest) { return; }
event.respondWith(new Response('Hello!')); });
/* * Response to SSE by stream / self.addEventListener('fetch', event => { const { headers } = event.request; const isSSERequest = headers.get('Accept') === 'text/event-stream';
if (!isSSERequest) { return; }
const responseText = 'Hello!'; const responseData = Uint8Array.from(responseText, x => x.charCodeAt(0)); const stream = new ReadableStream({ start: controller => controller.enqueue(responseData) }); const response = new Response(stream);
event.respondWith(response); });
/* * SSE chunk data / const sseChunkData = (data, event, retry, id) => Object.entries({ event, id, data, retry }) .filter(([, value]) => ![undefined, null].includes(value)) .map(([key, value]) =>
${key}: ${value}
) .join('\n') + '\n\n';/* * Success response to SSE from SW / self.addEventListener('fetch', event => { const { headers } = event.request; const isSSERequest = headers.get('Accept') === 'text/event-stream';
if (!isSSERequest) { return; }
const sseChunkData = (data, event, retry, id) => Object.entries({ event, id, data, retry }) .filter(([, value]) => ![undefined, null].includes(value)) .map(([key, value]) =>
${key}: ${value}
) .join('\n') + '\n\n';const sseHeaders = { 'content-type': 'text/event-stream', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', };
const responseText = sseChunkData('Hello!'); const responseData = Uint8Array.from(responseText, x => x.charCodeAt(0)); const stream = new ReadableStream({ start: controller => controller.enqueue(responseData) }); const response = new Response(stream, { headers: sseHeaders });
event.respondWith(response); });
/* * Result / self.addEventListener('fetch', event => { const { headers, url } = event.request; const isSSERequest = headers.get('Accept') === 'text/event-stream';
// Process only SSE connections if (!isSSERequest) { return; }
// Headers for SSE response const sseHeaders = { 'content-type': 'text/event-stream', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', }; // Function for formatting message to SSE response const sseChunkData = (data, event, retry, id) => Object.entries({ event, id, data, retry }) .filter(([, value]) => ![undefined, null].includes(value)) .map(([key, value]) =>
${key}: ${value}
) .join('\n') + '\n\n';// Map with server connections, where key - url, value - EventSource const serverConnections = {}; // For each request opens only one server connection and use it for next requests with the same url const getServerConnection = url => { if (!serverConnections[url]) { serverConnections[url] = new EventSource(url); }
return serverConnections[url];
}; // On message from server forward it to browser const onServerMessage = (controller, { data, type, retry, lastEventId }) => { const responseText = sseChunkData(data, type, retry, lastEventId); const responseData = Uint8Array.from(responseText, x => x.charCodeAt(0)); controller.enqueue(responseData); }; const stream = new ReadableStream({ start: controller => getServerConnection(url).onmessage = onServerMessage.bind(null, controller) }); const response = new Response(stream, { headers: sseHeaders });
event.respondWith(response); }); ```
-
-
-
```js self.addEventListener('fetch', event => { const { headers, url } = event.request; const isSSERequest = headers.get('Accept') === 'text/event-stream';
// We process only SSE connections if (!isSSERequest) { return; }
// Response Headers for SSE const sseHeaders = { 'content-type': 'text/event-stream', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', }; // Function formatting data for SSE const sseChunkData = (data, event, retry, id) => Object.entries({ event, id, data, retry }) .filter(([, value]) => ![undefined, null].includes(value)) .map(([key, value]) =>
${key}: ${value}
) .join('\n') + '\n\n'; // Table with server connections, where key is url, value is EventSource const serverConnections = {}; // For each url, we open only one connection to the server and use it for subsequent requests const getServerConnection = url => { if (!serverConnections[url]) serverConnections[url] = new EventSource(url);return serverConnections[url];
}; // When we receive a message from the server, we forward it to the browser const onServerMessage = (controller, { data, type, retry, lastEventId }) => { const responseText = sseChunkData(data, type, retry, lastEventId); const responseData = Uint8Array.from(responseText, x => x.charCodeAt(0)); controller.enqueue(responseData); }; const stream = new ReadableStream({ start: controller => getServerConnection(url).onmessage = onServerMessage.bind(null, controller) }); const response = new Response(stream, { headers: sseHeaders });
event.respondWith(response); }); ```
-
-
learn.microsoft.com learn.microsoft.com
-
cloudflare.tv cloudflare.tv
-
jeffy.info jeffy.info
-
astro-sw-demo.netlify.app astro-sw-demo.netlify.appAstro1
Tags
Annotators
URL
-
- May 2023
-
shaneosullivan.wordpress.com shaneosullivan.wordpress.com
- Mar 2023
-
workers.tools workers.tools
-
HTML templating and streaming response library for Worker Runtimes such as Cloudflare Workers.
js function handleRequest(event: FetchEvent) { return new HTMLResponse(pageLayout('Hello World!', html` <h1>Hello World!</h1> ${async () => { const timeStamp = new Date( await fetch('https://time.api/now').then(r => r.text()) ); return html`<p>The current time is ${timeEl(timeStamp)}.</p>` }} `)); }
Tags
Annotators
URL
-
-
www.builder.io www.builder.io
Tags
Annotators
URL
-
-
blog.bitsrc.io blog.bitsrc.io
-
alistapart.com alistapart.com
-
www.youtube.com www.youtube.com
Tags
Annotators
URL
-
-
www.youtube.com www.youtube.com
Tags
Annotators
URL
-
-
-
Streaming across worker threads
```js import { ReadableStream } from 'node:stream/web'; import { Worker } from 'node:worker_threads';
const readable = new ReadableStream(getSomeSource());
const worker = new Worker('/path/to/worker.js', { workerData: readable, transferList: [readable], }); ```
```js const { workerData: stream } = require('worker_threads');
const reader = stream.getReader(); reader.read().then(console.log); ```
Tags
Annotators
URL
-
- Feb 2023
- Dec 2022
-
webauthn.qwtel.workers.dev webauthn.qwtel.workers.dev
Tags
Annotators
URL
-
-
blog.nparashuram.com blog.nparashuram.com
-
TL;DR; A custom renderer for ReactJS that uses Web Workers to run the expensive Virtual DOM diffing calculations
-
-
blog.nparashuram.com blog.nparashuram.com
-
Tl;Dr; ReactJS is faster when Virtual DOM reconciliations are done on a Web Worker thread.
-
-
bugs.webkit.org bugs.webkit.org
Tags
Annotators
URL
-
-
cheatsheetseries.owasp.org cheatsheetseries.owasp.org
- Nov 2022
-
www.aquib.dev www.aquib.dev
Tags
Annotators
URL
-
-
vite-pwa-org.netlify.app vite-pwa-org.netlify.app
-
stackoverflow.com stackoverflow.com
-
ponyfoo.com ponyfoo.comPony Foo1
- Sep 2022
-
-
I mean something very precise by that so I'm going to try to explain with an analogy imagined imagine you adopt a puppy so 00:15:01 your Duff is puppy and your name um puddles you take puddles home and you give them a little snack and you stick puddles in the cage and you lock the door forever and never open it again and 00:15:14 puddle slips out the rest of his poor life trapped inside this little cage so that's wrong I think most of us would agree that's sadistic that obviously inhumane so well let's ask what exactly 00:15:27 is wrong about that you know what what is inhuman about sticking puddles in the cage well you know we kind of have a notion of what it means to live a full doggy life right dogs have to run around dogs run 00:15:40 around and they sniff other dogs and they pee on things and that's kind of what it means to be a dog they've inherited this the set of capabilities capabilities and traits from their wolf ancestors and we recognize that a dog 00:15:53 has to be allowed the full free expression of its entire range of capabilities by sticking the cage or constraining his range of experience you're not letting him do all the things that dogs can do and this is exactly 00:16:07 what we've done to ourselves we've invented media that severely constrained our range of intellectual experience that of all the many capabilities that 00:16:19 we have all the many ways of thinking that we have we have constrained ourselves to a tiny subset we're not allowed to use our full intellect
!- analogy : inhumanity of knowledge work - compared to a dog stuck in a cage
-
you can think about the invention of powerful representations and the invention of powerful media to host powerful 00:11:27 representations as being one of the big drivers of last 2,000 years of the intellectual progress of humanity because each representation allows us to think thoughts that we couldn't think before we kind of 00:11:39 continuously expand our think about territory so you can think of this as tied to you know the grand meta-narrative of the scent of humanity moving away from myth and superstition 00:11:51 and ignorance and towards a deeper understanding of ourselves in the world around us I bring this up explicitly because I think it's good for people to acknowledge the motivation for their 00:12:02 work and this is this story of the intellectual progress of humanity is something that I find very motivating inspiring and is something that I feel like I want to contribute to but I think 00:12:16 that if this if you take this as your motivation you kind of have to be honest with yourself that that there definitely has been ascent we have improved in many 00:12:27 ways but there are also other ways in which our history has not been ascent so we invent technology we media technology 00:12:39 to kind of help us make this this climb but every technology is a double-edged sword every technology enables us has a potential de navels in certain ways while debilitating us in other ways and 00:12:51 that's especially true for representations because the way the reputations work is they draw on certain capabilities that we have so if we go all in in a particular medium like we 00:13:03 did with print so the capabilities that are not well supported in that medium they get neglected in they atrophy and we atrophy I wish I knew who drew the picture 00:13:20 because it's it's a wonderful depiction of what I'm trying to express here and even a little misleading because the person the last stage they're kind of hunched over is tiny rectangle we reach 00:13:31 that stage accomplish that stage with the printing press and cheap paper book based knowledge the invention of paper-based bureaucracy paper-based 00:13:44 working we invented this lifestyle this way of working where to do knowledge work meant to sit at a desk and stare at your little tiny rectangle make a little motions of your hand you know started 00:13:56 out as sitting at a desk staring at papers or books and making little motions with a pen and now it's sitting at a desk staring at a computer screen making a little motions with your on a keyboard but it's basically the same 00:14:08 thing we've this is what it means to do knowledge work nowadays this is what it means to be a thinker it means to be sitting and working with symbols on a little tiny rectangle to the extent that 00:14:20 again it almost seems inseparable you can't separate the representation for what it actually is and and this is basically just an accident of history this is just the way that our media 00:14:32 technology happen to evolve and then we kind of designed a way of knowledge work for that media that we happen to have and I think so I'm going to make the claim that this style of knowledge work 00:14:47 this lifestyle is inhumane
!- for : symbolic representation - language - the representation is closely tied to the media - a knowledge worker sits at a desk and plays with symbols in a small area all day! - This is actually inhumane when you think about it
-
-
web.dev web.dev
-
- Aug 2022
-
gaplo917.github.io gaplo917.github.io
-
github.com github.com
-
The current web developmennt ONLY offload the tasks to web worker when the application encounter performance issues but NOT by the tasks' nature.
-
-
www.theguardian.com www.theguardian.com
-
Beaumont, P. (2021, September 16). Which countries are enforcing mandatory Covid jabs – and how? The Guardian. https://www.theguardian.com/world/2021/sep/16/which-countries-enforcing-mandatory-covid-vaccination
-
-
www.arcdigital.media www.arcdigital.media
-
Summers, D. (2021, September 24). I Am So Tired. https://www.arcdigital.media/p/i-am-so-tired
-
-
www.medrxiv.org www.medrxiv.org
-
Regev-Yochay, G., Gonen, T., Gilboa, M., Mandelboim, M., Indenbaum, V., Amit, S., Meltzer, L., Asraf, K., Cohen, C., Fluss, R., Biber, A., Nemet, I., Kliker, L., Joseph, G., Doolman, R., Mendelson, E., Freedman, L. S., Harats, D., Kreiss, Y., & Lustig, Y. (2022). 4th Dose COVID mRNA Vaccines’ Immunogenicity & Efficacy Against Omicron VOC (p. 2022.02.15.22270948). medRxiv. https://doi.org/10.1101/2022.02.15.22270948
-
-
developers.cloudflare.com developers.cloudflare.com
-
workers.js.org workers.js.org
-
-
www.theguardian.com www.theguardian.com
-
Campbell, D., Sabbagh, D., & Devlin, H. (2022, January 7). Military deployed at London hospitals due to Omicron staff shortages. The Guardian. https://www.theguardian.com/world/2022/jan/07/military-deployed-at-london-hospitals-due-to-omicron-staff-shortages
-
-
twitter.com twitter.com
-
ReconfigBehSci on Twitter: “RT @dgurdasani1: 3.5% of health and care workers already have long COVID- the highest across all occupations. How can we expect the NHS to…” / Twitter. (n.d.). Retrieved December 23, 2021, from https://twitter.com/SciBeh/status/1474026547753463817
-
-
Tags
Annotators
URL
-
- Jul 2022
-
tanstack.com tanstack.com
-
dougbelshaw.com dougbelshaw.com
-
I was particularly interested in Chris Aldrich’s observation that knowledge workers tend to talk in spatial terms about their work, especially if distracted. Following interruptions by colleagues or phone calls at work, people may frequently ask themselves “where was I?” more frequently than “what was I doing?” This colloquialism isn’t surprising as our memories for visual items and location are much stronger than actions. Knowledge workers will look around at their environments for contextual clues for what they were doing and find them in piles of paper on their desks, tabs in their computer browser, or even documents (physical or virtual) on their desktops.
-
- Jun 2022
- May 2022
-
yoyo-code.com yoyo-code.com
Tags
Annotators
URL
-
- Apr 2022
-
-
Batty, M., Murcio, R., Iacopini, I., Vanhoof, M., & Milton, R. (2020). London in Lockdown: Mobility in the Pandemic City. ArXiv:2011.07165 [Physics]. http://arxiv.org/abs/2011.07165
-
- Feb 2022
-
blog.petrieflom.law.harvard.edu blog.petrieflom.law.harvard.edu
-
wparmet. (2022, January 5). Major Questions about Vaccine Mandates, the Supreme Court, and the Major Questions Doctrine. Bill of Health. http://blog.petrieflom.law.harvard.edu/2022/01/05/major-questions-vaccine-mandates-supreme-court/
-
-
localforage.github.io localforage.github.io
Tags
Annotators
URL
-
-
www.nature.com www.nature.com
-
Hall, V. G., Ferreira, V. H., Wood, H., Ierullo, M., Majchrzak-Kita, B., Manguiat, K., Robinson, A., Kulasingam, V., Humar, A., & Kumar, D. (2022). Delayed-interval BNT162b2 mRNA COVID-19 vaccination enhances humoral immunity and induces robust T cell responses. Nature Immunology, 1–6. https://doi.org/10.1038/s41590-021-01126-6
-
-
-
- Jan 2022
-
threads.js.org threads.js.org
-
-
mmazzarolo.com mmazzarolo.com
-
A note on setting worker-loader’s publicPath with webpack 5
Webpack 5 introduced a mechanism to detect the publicPath that should be used automatically
[...]
Webpack 5 exposes a global variable called
__webpack_public_path__
that allows you to do that.// Updates the `publicPath` at runtime, overriding whatever was set in the // webpack's `output` section. __webpack_public_path__ = "/workers/"; const myWorker = new Worker( new URL("/workers/worker.js"); ); // Eventually, restore the `publicPath` to whatever was set in output. __webpack_public_path__ = "https://my-static-cdn/";
-
-
Tags
Annotators
URL
-
-
dzone.com dzone.com
Tags
Annotators
URL
-
-
rustwasm.github.io rustwasm.github.io
-
www.theguardian.com www.theguardian.com
-
Halliday, J., & correspondent, J. H. N. of E. (2022, January 17). ‘Christmas was awful’: On the Omicron frontline at the Royal Preston hospital. The Guardian. https://www.theguardian.com/world/2022/jan/17/christmas-was-awful-on-the-omicron-frontline-at-the-royal-preston-hospital
-
-
www.theatlantic.com www.theatlantic.com
-
Yong, E. (2021, December 16). America Is Not Ready for Omicron. The Atlantic. https://www.theatlantic.com/health/archive/2021/12/america-omicron-variant-surge-booster/621027/
Tags
- healthcare
- essential worker
- societal level
- immunity
- South Africa
- ventilation
- vaccine
- variant
- individualism
- society
- prediction
- previous infection
- is:news
- rapid testing
- transmissibility
- COVID-19
- protection
- hospitalization
- USA
- mortality
- policy
- booster
- severity
- hospital
- testing
- strategy
- Omicron
- lang:en
- mask wearing
Annotators
URL
-
-
www.barrons.com www.barrons.com
-
Nash, D. (n.d.). The CDC Got Lost Trying to Follow the Science. Retrieved January 14, 2022, from https://www.barrons.com/articles/cdc-guidance-covid-isolation-pandemic-51641847943
-
-
blogs.bmj.com blogs.bmj.com
-
Up the line to death: Covid-19 has revealed a mortal betrayal of the world’s healthcare workers. (2021, January 29). The BMJ. https://blogs.bmj.com/bmj/2021/01/29/up-the-line-to-death-covid-19-has-revealed-a-mortal-betrayal-of-the-worlds-healthcare-workers/
Tags
- Asia
- government
- workplace safety
- long-term
- mental health
- healthcare worker
- COVID-19
- global
- management
- UK
- protection
- mortality
- USA
- funding
- is:blog
- risk
- NHS
- lang:en
Annotators
URL
-
-
twitter.com twitter.com
-
Barry McAree 💙. (2022, January 6). Teachers on these islands will get FFP2(rightly so).Healthcare workers on other parts of these islands..nah!..Surgical masks/spit guards/not PPE,for working with COVID-positive patients risking other patient’s, our own & our family’s health.”Protect the NHS”🤔@CMO_England https://t.co/OngrD5BBPU [Tweet]. @BarryMcAree. https://twitter.com/BarryMcAree/status/1478883258305814536
-
- Dec 2021
-
webpack.js.org webpack.js.org
-
Web Workers
As of webpack 5, you can use Web Workers without
worker-loader
.Syntax
new Worker(new URL('./worker.js', import.meta.url));
Tags
Annotators
URL
-
-
web.dev web.dev
-
-
github.com github.com
-
// main.js const { RemoteReadableStream, RemoteWritableStream } = RemoteWebStreams; (async () => { const worker = new Worker('./worker.js'); // create a stream to send the input to the worker const { writable, readablePort } = new RemoteWritableStream(); // create a stream to receive the output from the worker const { readable, writablePort } = new RemoteReadableStream(); // transfer the other ends to the worker worker.postMessage({ readablePort, writablePort }, [readablePort, writablePort]); const response = await fetch('./some-data.txt'); await response.body // send the downloaded data to the worker // and receive the results back .pipeThrough({ readable, writable }) // show the results as they come in .pipeTo(new WritableStream({ write(chunk) { const results = document.getElementById('results'); results.appendChild(document.createTextNode(chunk)); // tadaa! } })); })();
// worker.js const { fromReadablePort, fromWritablePort } = RemoteWebStreams; self.onmessage = async (event) => { // create the input and output streams from the transferred ports const { readablePort, writablePort } = event.data; const readable = fromReadablePort(readablePort); const writable = fromWritablePort(writablePort); // process data await readable .pipeThrough(new TransformStream({ transform(chunk, controller) { controller.enqueue(process(chunk)); // do the actual work } })) .pipeTo(writable); // send the results back to main thread };
-
-
stackoverflow.com stackoverflow.com
-
What you're trying to do is known as the "Application Shell" architectural pattern.
The trick is to have your service worker's
fetch
handler check to see whether an incoming request is a navigation (event.request.mode === 'navigate'
), and if so, respond with the cached App Shell HTML (which sounds like/index.html
in your case).A generic way of doing this would be:
self.addEventListener('fetch', (event) => { if (event.request.mode === 'navigate') { event.respondWith(caches.match('/index.html')); } else { // Your other response logic goes here. } });
This will cause your service worker to behave in a similar fashion to how you're web server is already configured.
-
-
twitter.com twitter.com
-
ReconfigBehSci. (2021, December 22). RT @Rebeccasmt: Exclusive: Hospitals plan for ‘mass casualty’ event with up to one-third of staff sick https://t.co/bwA1s80SgZ [Tweet]. @SciBeh. https://twitter.com/SciBeh/status/1473604922910380032
-
-
vancouversun.com vancouversun.com
-
227 B.C. chiropractors threaten to sue regulatory college if vaccines ordered. (n.d.). Vancouversun. Retrieved December 17, 2021, from https://vancouversun.com/news/local-news/227-b-c-chiropractors-threaten-to-sue-regulatory-college-if-vaccines-ordered
-
-
developers.google.com developers.google.com
-
developers.cloudflare.com developers.cloudflare.com
-
Fetch and modify response properties which are immutable by creating a copy first.
/** * @param {string} headerNameSrc Header to get the new value from * @param {string} headerNameDst Header to set based off of value in src */ const headerNameSrc = "foo" //"Orig-Header" const headerNameDst = "Last-Modified" async function handleRequest(request) { /** * Response properties are immutable. To change them, construct a new * Response and pass modified status or statusText in the ResponseInit * object. Response headers can be modified through the headers `set` method. */ const originalResponse = await fetch(request) // Change status and statusText, but preserve body and headers let response = new Response(originalResponse.body, { status: 500, statusText: "some message", headers: originalResponse.headers, }) // Change response body by adding the foo prop const originalBody = await originalResponse.json() const body = JSON.stringify({ foo: "bar", ...originalBody }) response = new Response(body, response) // Add a header using set method response.headers.set("foo", "bar") // Set destination header to the value of the source header const src = response.headers.get(headerNameSrc) if (src != null) { response.headers.set(headerNameDst, src) console.log( `Response header "${headerNameDst}" was set to "${response.headers.get( headerNameDst, )}"`, ) } return response } addEventListener("fetch", event => { event.respondWith(handleRequest(event.request)) })
-
-
twitter.com twitter.com
-
shinydoc. (2021, December 12). I love how I, an actual GP...who was involved in the initial covid vaccination programme ...has to tune in at 8pm with the public to find out that apparently we are vaccinating the entire adult population with boosters by the end of the year [Tweet]. @irishayesha. https://twitter.com/irishayesha/status/1470123478221303810
-
-
medium.com medium.com
-
// To know the maximum numbers of thread that can be used // on user’s system, use window.navigator.hardwareConcurrency property.
-
-
solidstudio.io solidstudio.io
Tags
Annotators
URL
-
-
twitter.com twitter.com
-
Progressive International. (2021, November 29). BREAKING: 2.5 million nurses from 28 countries have filed for a UN investigation of human rights violations by the EU, UK, Switzerland, Norway, and Singapore for blocking the waiver on Covid-19 vaccine patents as new strains proliferate: Http://covid19criminals.exposed https://t.co/Rj37RqDA4J [Tweet]. @ProgIntl. https://twitter.com/ProgIntl/status/1465202919687348227
-
- Nov 2021
-
www.theguardian.com www.theguardian.com
-
Otte, J. (2021, November 11). ‘No jab, no job’: Care home workers in England on the Covid vaccine mandate. The Guardian. https://www.theguardian.com/society/2021/nov/11/england-care-home-workers-on-mandatory-covid-vaccines
-
-
www.theguardian.com www.theguardian.com
-
Jones, S., & Giuffrida, A. (2021, November 9). At a glance: Covid vaccine mandates around the world. The Guardian. https://www.theguardian.com/world/2021/nov/09/covid-vaccine-mandates-around-the-world
-
- Oct 2021
-
www.reuters.com www.reuters.com
-
Douglas, L. (2021, October 28). Coronavirus infections at U.S. meat plants far higher than previous estimates -House subcommittee. Reuters. https://www.reuters.com/world/us/coronavirus-infections-us-meat-plants-far-higher-than-previous-estimates-house-2021-10-27/
-
-
twitter.com twitter.com
-
Kenneth Baillie. (2021, October 27). When a healthcare system fails, increasing numbers of people suffer and die needlessly. That’s all. If you aren’t a patient or staff, you don’t see it. But this is happening, now, all over the UK. 2/n [Tweet]. @kennethbaillie. https://twitter.com/kennethbaillie/status/1453422360795680769
-
-
news.bloomberglaw.com news.bloomberglaw.com
-
Vaccine Mandates Withstand Challenges as Suits Surge Across U.S. (n.d.). Retrieved 25 October 2021, from https://news.bloomberglaw.com/daily-labor-report/vaccine-mandates-withstand-challenges-as-lawsuits-proliferate
Tags
- COVID-19
- advocacy group
- employer
- USA
- legality
- vaccine mandate
- court
- legal challenge
- vaccination
- mandate
- lawsuite
- workplace
- is:news
- lang:en
- worker
Annotators
URL
-
-
www.bmj.com www.bmj.com
-
Mahase, E. (2021). Covid-19: Antibody levels fall after second Pfizer dose, but protection against severe disease remains, studies indicate. BMJ, 375, n2481. https://doi.org/10.1136/bmj.n2481
-
-
twitter.com twitter.com
-
Michael Eisen on Twitter. (n.d.). Twitter. Retrieved 8 October 2021, from https://twitter.com/mbeisen/status/1443201806272643073
-