Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting Capabilities #1574

Merged
merged 8 commits into from
Nov 29, 2020
Merged

Syntax Highlighting Capabilities #1574

merged 8 commits into from
Nov 29, 2020

Conversation

agarwalbharat
Copy link
Member

Syntax Highlighting Capabilities for HTML, CSS, JS and SQL added

please check generate_chapters.js, 2019.css and package.json file.

@agarwalbharat agarwalbharat requested a review from a team November 25, 2020 15:46
@rviscomi rviscomi added the development Building the Almanac tech stack label Nov 25, 2020
@rviscomi rviscomi added this to the 2020 Platform Development milestone Nov 25, 2020
Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tired it out yet, but looks like the way I think we should implement it so good stuff.

However, I do have some comments for you to look at. After that will give it a trial run.

src/package.json Outdated Show resolved Hide resolved
src/package.json Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
@tunetheweb
Copy link
Member

Also I see Lighthouse is complaining as we have some invisible text so might need to look at the CSS we've chosen for these styles.

Lighthouse errors

P.S. I love our automated testing to catch these things!! 🎉

@agarwalbharat
Copy link
Member Author

@bazzadp, Changes are done as per Review

@agarwalbharat agarwalbharat linked an issue Nov 27, 2020 that may be closed by this pull request
@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 27, 2020
@tunetheweb
Copy link
Member

Looking good from a brief scan of the code! Will spend some time testing this today and let you know how I get on.

One comment so far is that the Methodology section now uses different Syntax highlighting for its SQL snippet. We should move that to Rainbow format, and remove its custom code CSS, so we don’t need to maintain two and so we can auto-generate it in future. But let’s merge this first and then look at that separately as there are quite a lot of Methodology files to change with all the various translations, so this initial PR for the chapters is easier to read and review.

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great @bharatagsrwal ! Brilliant work.

Just a few small changes and I think this is good to merge.

src/static/css/2019.css Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
src/tools/generate/generate_chapters.js Outdated Show resolved Hide resolved
src/tools/generate/generate_syntax_highlighting.js Outdated Show resolved Hide resolved
src/tools/generate/generate_syntax_highlighting.js Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
@rviscomi
Copy link
Member

I haven't taken a close look at this PR but one request I have is to try to keep the syntax highlighting color scheme as close to the manual one used on the Methodology page. Those colors were chosen by the site designer to match our overall palette, so it'd be great to continue to use those for consistency. Do we have the ability to override the default theme colors of the syntax highlighter tool?

@tunetheweb
Copy link
Member

tunetheweb commented Nov 27, 2020

Yup. The syntax highlighter tool is merely used to apply the HTML spans with classes for each supported language (JS, HTML, CSS and SQL). The CSS for those classes is in 2019.css (though my understanding is it was based on one of the suggested styles from the tool).

@bharatagsrwal could you look at the Methodology page and see what changes we need to do to bring this inline?

@rviscomi as I mentioned above, after we merge this we’ll look at changing the Methodology chapter to use the same spans and classes and remove the CSS from that page so it uses the same one. That should result in no visual change to Methodology page but consistent code. But as there are a lot of Methodology pages will land this first, and then do that next. Maybe as part of that we should make the SQL a function call to avoid repeating it so much in eat translation even though it’s not translated? Anyway, as I say, let’s land this first.

@agarwalbharat
Copy link
Member Author

agarwalbharat commented Nov 28, 2020

okay, we just need to change the colors in CSS and we are good to do, so I will change those and make it the same as in the Methodology page

@agarwalbharat
Copy link
Member Author

image

image

How about these? I have changed to those colors which are on the methodology page

@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@tunetheweb
Copy link
Member

image

image

How about these? I have changed to those colors which are on the methodology page

@rviscomi what do you think about something else for strings? Something like #e74c3c ?

Strong string highlighting

Without making this a least a bit more different you kind of lose the benefit of having syntax highlighting!

We don't have any string syntax highlighting in Methodology, which is why it's subtlety have not been noticed before, but comments and numbers are more visually different, so I think strings should be too:

Methodology SQL high lighting

@rviscomi
Copy link
Member

+1 for more contrast, that was my first impression of #1574 (comment) as well.

The table name in the query (with backticks) is also technically a string if we wanted to keep it consistent.

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK let's land this thing! Two small changes.

src/static/css/2019.css Outdated Show resolved Hide resolved
src/static/css/2019.css Outdated Show resolved Hide resolved
@agarwalbharat
Copy link
Member Author

agarwalbharat commented Nov 29, 2020

if we wanted to keep it consiste

yes, but it seems like it is not a string, the color is almost the same as the default color, so I think @bazzadp #e74c3c this color can be a good option for strings

@tunetheweb
Copy link
Member

tunetheweb commented Nov 29, 2020

+1 for more contrast, that was my first impression of #1574 (comment) as well.

The table name in the query (with backticks) is also technically a string if we wanted to keep it consistent.

Looks like the Rainbow library we're using is clever enough to pick this up! This is what the SQL looks like when run through that:

SQL syntax highlighting

Though interesting enough it doesn't recognise # as a comment in SQL so will need to manually apply the comment span for that.

@agarwalbharat
Copy link
Member Author

+1 for more contrast, that was my first impression of #1574 (comment) as well.
The table name in the query (with backticks) is also technically a string if we wanted to keep it consistent.

Looks like the Rainbow library we're using is clever enough to pick this up! This is what the SQL looks like when run through that:

SQL syntax highlighting

Though interesting enough it doesn't recognise # as a comment in SQL so will need to manually apply the comment span for that.

you did by Firstly converting using rainbow and pasting code in HTML file?

@tunetheweb
Copy link
Member

tunetheweb commented Nov 29, 2020

you did by Firstly converting using rainbow and pasting code in HTML file?

Nope. I copied the raw SQL from rendered Methodology page and then temporarily put it in the capabilities chapter page in a sql block and generated the chapter to see what it would look like. Did it perfectly (apart from that comment) first time.

So yeah basically the same :-)

Will submit a PR to rainbow to add # as a SQL comment but in meantime as it's HTML we can add the span manually when we move the Methodology page over to this.

@tunetheweb
Copy link
Member

PR to add # comments to Rainbow: ccampbell/rainbow#250. Hopefully will be accepted so we get this in next version.

@bharatagsrwal you happy to accept those two small changes I suggested so we can merge this?

@agarwalbharat
Copy link
Member Author

PR to add # comments to Rainbow: ccampbell/rainbow#250. Hopefully will be accepted so we get this in next version.

@bharatagsrwal you happy to accept those two small changes I suggested so we can merge this?

Yap, I am doing the changes, so what color should be for String, is it that red one or the same as of now?

@agarwalbharat
Copy link
Member Author

@tunetheweb
Copy link
Member

Orange is always a tough one.

#B31107 is the best I can find after plugging it into: https://contrast-finder.tanaguru.com/result.html?foreground=%23FFFFFF&background=%23e74c3c&ratio=7&isBackgroundTested=true&algo=Rgb&distanceSort=asc

@agarwalbharat
Copy link
Member Author

agarwalbharat commented Nov 29, 2020

#B31107

image

image

looks good

@github-actions
Copy link
Contributor

Please note, that the following diffs happen in the templates on this branch compared to main:

diff -r templates/en/2019/chapters/javascript.html templates_new/en/2019/chapters/javascript.html
285c285
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
290c290
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/en/2019/ebook.html templates_new/en/2019/ebook.html
313c313
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
323c323
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/en/2020/chapters/capabilities.html templates_new/en/2020/chapters/capabilities.html
196,198c196,198
< <pre><code class="js language-js">registration.showNotification('Title', {
<   body: 'Message',
<   showTrigger: new TimestampTrigger(timestamp),
---
> <pre><code class="js language-js">registration.<span class="function call">showNotification</span>(<span class="string">'Title'</span>, {
>   body: <span class="string">'Message'</span>,
>   showTrigger: <span class="keyword">new</span> <span class="variable type">TimestampTrigger</span>(timestamp),
216,217c216,217
< <pre><code class="js language-js">registration.periodicSync.register('articles', {
<   minInterval: 24 * 60 * 60 * 1000 // one day
---
> <pre><code class="js language-js">registration.periodicSync.<span class="function call">register</span>(<span class="string">'articles'</span>, {
>   minInterval: <span class="constant numeric">24</span> <span class="keyword operator">*</span> <span class="constant numeric">60</span> <span class="keyword operator">*</span> <span class="constant numeric">60</span> <span class="keyword operator">*</span> <span class="constant numeric">1000</span> <span class="comment">// one day</span>
221,223c221,223
< <pre><code class="js language-js">self.addEventListener('periodicsync', (event) =&gt; {
<   if (event.tag === 'articles') {
<     event.waitUntil(syncStuff());
---
> <pre><code class="js language-js"><span class="keyword">self</span>.<span class="function call">addEventListener</span>(<span class="string">'periodicsync'</span>, (event) <span class="storage type function arrow">=&gt;</span> {
>   <span class="keyword">if</span> (event.tag <span class="keyword operator">=</span><span class="keyword operator">=</span><span class="keyword operator">=</span> <span class="string">'articles'</span>) {
>     event.<span class="function call">waitUntil</span>(<span class="function call">syncStuff</span>());
232,234c232,234
< <pre><code class="js language-js">const relatedApps = await navigator.getInstalledRelatedApps();
< relatedApps.forEach((app) =&gt; {
<   console.log(app.id, app.platform, app.url);
---
> <pre><code class="js language-js"><span class="storage type">const</span> relatedApps <span class="keyword operator">=</span> await navigator.<span class="function call">getInstalledRelatedApps</span>();
> relatedApps.<span class="keyword">forEach</span>((app) <span class="storage type function arrow">=&gt;</span> {
>   console.<span class="function call">log</span>(app.id, app.platform, app.url);
247,250c247,250
< <pre><code class="js language-js">const wss = new WebSocketStream(WSS_URL);
< const {readable, writable} = await wss.connection;
< const reader = readable.getReader();
< const writer = writable.getWriter();</code></pre>
---
> <pre><code class="js language-js"><span class="storage type">const</span> wss <span class="keyword operator">=</span> <span class="keyword">new</span> <span class="variable type">WebSocketStream</span>(WSS_URL);
> <span class="storage type">const</span> {readable, writable} <span class="keyword operator">=</span> await wss.connection;
> <span class="storage type">const</span> reader <span class="keyword operator">=</span> readable.<span class="function call">getReader</span>();
> <span class="storage type">const</span> writer <span class="keyword operator">=</span> writable.<span class="function call">getWriter</span>();</code></pre>
256c256
< <pre><code class="js language-js">const transport = new QuicTransport(QUIC_URL);
---
> <pre><code class="js language-js"><span class="storage type">const</span> transport <span class="keyword operator">=</span> <span class="keyword">new</span> <span class="variable type">QuicTransport</span>(QUIC_URL);
259,260c259,260
< const ws = transport.sendDatagrams();
< const stream = await transport.createSendStream();</code></pre>
---
> <span class="storage type">const</span> ws <span class="keyword operator">=</span> transport.<span class="function call">sendDatagrams</span>();
> <span class="storage type">const</span> stream <span class="keyword operator">=</span> await transport.<span class="function call">createSendStream</span>();</code></pre>
diff -r templates/en/2020/chapters/markup.html templates_new/en/2020/chapters/markup.html
349c349
< <pre><code class="html language-html">&lt;!-- This is a comment in HTML --&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="comment html">&lt;!-- This is a comment in HTML --&gt;</span></code></pre>
354c354
< <pre><code class="html language-html">&lt;!--[if IE 8]&gt;
---
> <pre><code class="html language-html"><span class="comment html">&lt;!--[if IE 8]&gt;
356c356
< &lt;![endif]--&gt;</code></pre>
---
> &lt;![endif]--&gt;</span></code></pre>
472,476c472,476
< <pre><code class="html language-html">&lt;details&gt;
<   &lt;summary&gt;Status: Operational&lt;/summary&gt;
<   &lt;p&gt;Velocity: 12m/s&lt;/p&gt;
<   &lt;p&gt;Direction: North&lt;/p&gt;
< &lt;/details&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="support tag"><span class="support tag">&lt;</span><span class="support tag-name">details</span></span><span class="support tag close">&gt;</span>
>   <span class="support tag"><span class="support tag">&lt;</span><span class="support tag-name">summary</span></span><span class="support tag close">&gt;</span>Status: Operational<span class="support tag"><span class="support tag">&lt;</span><span class="support tag special">/</span><span class="support tag-name">summary</span></span><span class="support tag close">&gt;</span>
>   <span class="support tag"><span class="support tag">&lt;</span><span class="support tag-name">p</span></span><span class="support tag close">&gt;</span>Velocity: 12m/s<span class="support tag"><span class="support tag">&lt;</span><span class="support tag special">/</span><span class="support tag-name">p</span></span><span class="support tag close">&gt;</span>
>   <span class="support tag"><span class="support tag">&lt;</span><span class="support tag-name">p</span></span><span class="support tag close">&gt;</span>Direction: North<span class="support tag"><span class="support tag">&lt;</span><span class="support tag special">/</span><span class="support tag-name">p</span></span><span class="support tag close">&gt;</span>
> <span class="support tag"><span class="support tag">&lt;</span><span class="support tag special">/</span><span class="support tag-name">details</span></span><span class="support tag close">&gt;</span></code></pre>
diff -r templates/es/2019/chapters/javascript.html templates_new/es/2019/chapters/javascript.html
285c285
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
292c292
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/fr/2019/chapters/javascript.html templates_new/fr/2019/chapters/javascript.html
287c287
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
292c292
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/ja/2019/chapters/javascript.html templates_new/ja/2019/chapters/javascript.html
285c285
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
290c290
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/ja/2019/ebook.html templates_new/ja/2019/ebook.html
313c313
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
323c323
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/pt/2019/chapters/javascript.html templates_new/pt/2019/chapters/javascript.html
285c285
< <pre><code class="html language-html">&lt;script type="module" src="main.mjs"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">type</span>=<span class="string">"module"</span> <span class="entity tag script attribute">src</span>=<span class="string">"main.mjs"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
290c290
< <pre><code class="html language-html">&lt;script nomodule src="fallback.js"&gt;&lt;/script&gt;</code></pre>
---
> <pre><code class="html language-html"><span class="source js embedded"><span class="support tag script">&lt;</span><span class="entity tag script">script</span> <span class="entity tag script attribute">nomodule</span> <span class="entity tag script attribute">src</span>=<span class="string">"fallback.js"</span><span class="support tag script">&gt;</span><span class="support tag script">&lt;/</span><span class="entity tag script">script</span><span class="support tag script">&gt;</span></span></code></pre>
diff -r templates/ru/2020/chapters/capabilities.html templates_new/ru/2020/chapters/capabilities.html
211,213c211,213
< <pre><code class="js language-js">registration.showNotification('Title', {
<   body: 'Message',
<   showTrigger: new TimestampTrigger(timestamp),
---
> <pre><code class="js language-js">registration.<span class="function call">showNotification</span>(<span class="string">'Title'</span>, {
>   body: <span class="string">'Message'</span>,
>   showTrigger: <span class="keyword">new</span> <span class="variable type">TimestampTrigger</span>(timestamp),
237,238c237,238
< <pre><code class="js language-js">registration.periodicSync.register('articles', {
<   minInterval: 24 * 60 * 60 * 1000 // один день
---
> <pre><code class="js language-js">registration.periodicSync.<span class="function call">register</span>(<span class="string">'articles'</span>, {
>   minInterval: <span class="constant numeric">24</span> <span class="keyword operator">*</span> <span class="constant numeric">60</span> <span class="keyword operator">*</span> <span class="constant numeric">60</span> <span class="keyword operator">*</span> <span class="constant numeric">1000</span> <span class="comment">// один день</span>
270,273c270,273
< <pre><code class="js language-js">const wss = new WebSocketStream(WSS_URL);
< const {readable, writable} = await wss.connection;
< const reader = readable.getReader();
< const writer = writable.getWriter();</code></pre>
---
> <pre><code class="js language-js"><span class="storage type">const</span> wss <span class="keyword operator">=</span> <span class="keyword">new</span> <span class="variable type">WebSocketStream</span>(WSS_URL);
> <span class="storage type">const</span> {readable, writable} <span class="keyword operator">=</span> await wss.connection;
> <span class="storage type">const</span> reader <span class="keyword operator">=</span> readable.<span class="function call">getReader</span>();
> <span class="storage type">const</span> writer <span class="keyword operator">=</span> writable.<span class="function call">getWriter</span>();</code></pre>
279c279
< <pre><code class="js language-js">const transport = new QuicTransport(QUIC_URL);
---
> <pre><code class="js language-js"><span class="storage type">const</span> transport <span class="keyword operator">=</span> <span class="keyword">new</span> <span class="variable type">QuicTransport</span>(QUIC_URL);
282,283c282,283
< const ws = transport.sendDatagrams();
< const stream = await transport.createSendStream();</code></pre>
---
> <span class="storage type">const</span> ws <span class="keyword operator">=</span> transport.<span class="function call">sendDatagrams</span>();
> <span class="storage type">const</span> stream <span class="keyword operator">=</span> await transport.<span class="function call">createSendStream</span>();</code></pre>

@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@HTTPArchive HTTPArchive deleted a comment from github-actions bot Nov 29, 2020
@tunetheweb tunetheweb merged commit 8b510c9 into main Nov 29, 2020
@tunetheweb tunetheweb deleted the syntax-highlighting branch November 29, 2020 21:11
@agarwalbharat agarwalbharat self-assigned this Nov 29, 2020
@tunetheweb
Copy link
Member

@bharatagsrwal just realised you're not in the contributors json. Could you submit a PR with your details adding yourself to the developers team so you appear on our contributors page? Contributors are listed alphabetically by first name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Building the Almanac tech stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants