Skip to content

Commit bfaab0b

Browse files
committed
Deployed 8106690 to 2025.8.1 with MkDocs 1.6.1 and mike 1.1.2
1 parent e3474b6 commit bfaab0b

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

2025.8.1/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

2025.8.1/sitemap.xml.gz

0 Bytes
Binary file not shown.

2025.8.1/user-guide/workers/index.html

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,18 +1012,21 @@ <h3 id="option-2-service-worker-attribute">Option 2: <code>service-worker</code>
10121012
<p>Each <code>&lt;script type="m/py"&gt;</code> or <code>&lt;m/py-script&gt;</code> may optionally have
10131013
a <code>service-worker</code> attribute pointing to a locally served file (the
10141014
same way <code>mini-coi.js</code> needs to be served).</p>
1015+
<p>Such file needs to orchestrate <em>coincident</em> <em>POST</em> requests so that:</p>
10151016
<ul>
1016-
<li>You can chose <code>mini-coi.js</code> itself or <em>any other custom service worker</em>,
1017-
as long as it provides either the right headers to enable synchronous
1018-
operations via Atomics, or it enables
1019-
<a href="https://github.com/WebReflection/sabayon?tab=readme-ov-file#service-worker">sabayon polyfill events</a>.</li>
1020-
<li>Alternatively, you can copy and paste the
1021-
<a href="https://raw.githubusercontent.com/WebReflection/sabayon/main/dist/sw.js">sabayon Service Worker</a>
1022-
into your local project and point at that in the attribute. This will
1023-
not change the original behavior of your project, it will not interfere with
1024-
all default or pre-defined headers your application uses already but it will
1025-
<strong>fallback to a (slower but working) synchronous operation</strong> that allows
1026-
both <code>window</code> and <code>document</code> access in your worker logic.</li>
1017+
<li>you can copy and paste the
1018+
<a href="https://cdn.jsdelivr.net/npm/coincident/dist/sw.js">coincident Service Worker</a>
1019+
into your local project and point at that via the <code>service-worker</code> attribute.
1020+
This will not change the original behavior of your project, it will not
1021+
interfere with all default or pre-defined headers your application uses
1022+
already but it will
1023+
<strong>fallback to a (slower but working) synchronous operation</strong>
1024+
that allows both <code>window</code> and <code>document</code> access in your worker logic.</li>
1025+
<li>you can import
1026+
<a href="https://github.com/WebReflection/coincident/blob/main/src/sabayon/listeners.js">coincident listeners</a>
1027+
in your project and at least add the <code>fetc</code> one before your listeners.
1028+
It will automatically stop propagation when a request is meant to be handled
1029+
so that the rest of your logic will not be affected or change by any mean.</li>
10271030
</ul>
10281031
<div class="language-html highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="p">&lt;</span><span class="nt">html</span><span class="p">&gt;</span>
10291032
</span><span id="__span-2-2"><a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a> <span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
@@ -1040,11 +1043,11 @@ <h3 id="option-2-service-worker-attribute">Option 2: <code>service-worker</code>
10401043
</span></code></pre></div>
10411044
<div class="admonition warning">
10421045
<p class="admonition-title">Warning</p>
1043-
<p>Using sabayon as the fallback for synchronous operations via Atomics
1046+
<p>Using <em>coincident</em> as the fallback for synchronous operations via Atomics
10441047
should be <strong>the last solution to consider</strong>. It is inevitably
10451048
slower than using native Atomics.</p>
1046-
<p>If you must use sabayon, always reduce the amount of synchronous
1047-
operations by caching references from the <em>main</em> thread.</p>
1049+
<p>If you must use <code>service-worker</code> attribute, always reduce the amount of
1050+
synchronous operations by caching references from the <em>main</em> thread.</p>
10481051
<div class="language-python highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="c1"># ❌ THIS IS UNNECESSARILY SLOWER</span>
10491052
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="kn">from</span><span class="w"> </span><span class="nn">pyscript</span><span class="w"> </span><span class="kn">import</span> <span class="n">document</span>
10501053
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a>

0 commit comments

Comments
 (0)