Internet Weekly #116 | Stefan Judis Internet Construction

Internet Weekly #116 | Stefan Judis Internet Construction

[ad_1]

Hi, hi Buddies! 👋

How does reactivity paintings in JS frameworks? What is the take care of the oklch() CSS colour serve as? And the way are you able to send responsive movies on the internet?

This week’s Internet Weekly comprises all of the solutions and a lot more. Revel in!

GitHub rolled out new markdown rendering options to offer authors extra styling choices. And so they proceed to mess with prolong the markdown syntax.

GitHub Markdown example showing how a custom blockquote syntax is rendered to a colored highlight note with an icon.

You’ll be able to now render a customized headline, icon and a few colour in the event you use a blockquote with the > [!NOTE] syntax. Fancy!

In overall, there are !NOTE, !TIP, !IMPORTANT, !WARNING and !CAUTION.

Note, Tip, Important, Warning, Caution rendered in the GitHub UI.

And that is the reason all cool, however I am simply no fan of those customized markdown answers. It is all fantastic for GitHub, certain, however GitHub markdown does not keep on GitHub. npm is just one instance; does npm give a boost to this rendering syntax? (I do not know…)

And what occurs if a markdown renderer does not know what to make of > ![NOTE]?

Common rendering of the new markdown syntax leading to "[!NOTE]" in the rendered result.

Is that this extraordinarily damaged? I suppose now not. However is it nice? Under no circumstances.

And why do not they standardize those callouts? The GitHub flavoured markdown spec used to be ultimate up to date 3 years in the past. 🤔

And I stay serious about Markdown usually. It’s extensible via default with just right previous HTML. Why now not use it? The main points component works on Github, and give a boost to for the image component used to be added to allow darkish mode pictures. Why now not use one thing HTML-like?

And as extra persons are speaking about internet elements in recent years, why now not have a <callout /> part? It would permit for atmosphere a callout headline, Octicon and colour.

There are likely causes I do not know. And I will’t even believe delivery for an target audience like GitHub’s. I will undertake the brand new syntax for problems and PRs however might be very wary when the use of it in readmes.

Both means, have amusing styling your PRs, problems and medical doctors! (or now not)

Tips on how to shim local Node modules in a serverless global

JavaScript code: export function stat(file: string, cb: (err: Error, stat?: any) => void) {   cb(new Error('No filesystem')); }

If you are jamming within the serverless global, you will have encountered eventualities the place local Node.js modules or globals like fs or Buffer don’t seem to be to be had. Too unhealthy, however as soon as you might be conscious, your supply code can paintings round it.

However what if you wish to use an npm bundle that isn’t constructed for serverless, and it mechanically reaches for the report gadget?

George MacKerron describes learn how to shim applications and use bundler magic to levarage the ecosystem. Fancy!

Use the ecosystem all over the place

Tips on how to construct your individual reactive DOM framework

So there you have it. In the span of one (lengthy) blog post, we’ve implemented our very own JavaScript framework. Feel free to use this as the foundation for your brand-new JavaScript framework, to release to the world and enrage the Hacker News crowd.

Nolan Lawson explains how it is advisable to compete with Lit, Svelte and Forged via writing your individual JS framework. Must you do it? Please do not!

However this is an in-depth article masking tagged template literals, the template component, and the Proxy object. And these kind of are just right to find out about. 👏

Use the platform

How browsers review a component’s width and peak

The secret is in this summation: to determine width you look up the tree, to determine height you look down the tree.

Jim Nielsen quoted Josh Comeau about one thing I might by no means considered when doing web page structure. Wild!

Reconsider your layouting

Code examples for Netlify Blobs and Netlify Image CDN

Nearly all my issues run on Netlify. And I used to be fearful already as a result of, featurewise, it is been somewhat quiet. However two new betas simply entered the level.

I am very enthusiastic about garage to ditch my Airtable connections. However ahead of going all in, needless to say the pricing of each and every remains to be tbd. 💸

The paint order of view transitions

CSS code: ::view-transition-group(footer) {   z-index: 100; }

Perhaps you may have performed with view transitions (Chromium-only) already and spotted that animated components are all the time rendered above different components — even fixed-positioned ones.

Nic Chan shared learn how to paintings round this habits. 👏

Stack your transitions

The glorious bizarre internet – stranger.video

"Stranger video" next to Stefan looking into the camera

I had a just right snort the day before today. stranger.video connects you with random other folks to play a starring recreation. Whoever blinks first loses. Someday, we have been 8 other folks staring each and every different into the bottom. 😆

Clearly, this concept offers robust chatroulette vibes, and to keep away from all of the creeps, it blanks the digicam if there is anything else however eyes to look. Bravo!

Stare at other folks

What are your favourite web corners? Ship them my means, and I will come with them in Internet Weekly!

No longer so “bizarre” debugging tips

JavaScript code: (function () {    let last = document.activeElement;    setInterval(() => {      if (document.activeElement !== last) {        last = document.activeElement;        console.log("Focus changed to: ", last);      }    }, 100);  })();

Brief’n’candy: Alan Norbauer accrued 12 palms stuffed with JavaScript debugging tips. I am certain you can to find one thing precious in there!

Debug like a professional

Sudden CSS selector information

Be careful! .a .b .c is not the same as .a :is(.b .c). The first matches any .c that is a child of .b that is a child of .a. The second matches any .c that is a child of .a and .b, regardless of order!

It is time to open a bottle of champaign as a result of with :has(), :is(), :the place() and local selector nesting, CSS is getting increasingly tremendous powers. However the brand new and glossy comes with some footguns.

Scott Vandehey shared moderately a couple of! 👏

Get shocked

oklch() keeps lightness on hue rotation

The same color displayed in hsl() and oklch(). When changing the hue angle oklch() retains its perceived lightness while hsl() can be drastically lighter/darker.

I after all made the time to play with oklch() and sought after to look if this new colour serve as maps human lightness belief as promised. Spoiler: it does!

Keep away from distinction problems

Random MDN – autocomplete

HTML code: &lt;label for=&quot;firstName&quot;&gt;First Name:&lt;/label&gt; &lt;input name=&quot;firstName&quot; id=&quot;firstName&quot; type=&quot;text&quot; autocomplete=&quot;given-name&quot; /&gt;  &lt;label for=&quot;lastName&quot;&gt;Last Name:&lt;/label&gt; &lt;input name=&quot;lastName&quot; id=&quot;lastName&quot; type=&quot;text&quot; autocomplete=&quot;family-name&quot; /&gt;  &lt;label for=&quot;email&quot;&gt;Email:&lt;/label&gt; &lt;input name=&quot;email&quot; id=&quot;email&quot; type=&quot;email&quot; autocomplete=&quot;off&quot; /&gt;

From the limitless MDN wisdom archive…

Do you employ autocomplete and all of the proper characteristic values to make automagically filling bureaucracy as simple as conceivable? Perhaps you must. 😉

Ease auto-completion

JavaScript code: document.querySelector('.some-elem').scrollIntoView({   behavior: 'smooth', // 'auto' or 'smooth'   block: 'center',    // 'start', 'center', 'end' or 'nearest'   inline: 'center'    // 'start', 'center', 'end' or 'nearest' });

Do you know that whilst you scroll components into view with scrollIntoView, you’ll be able to outline the place the component must be scrolled to? Now you do!

Scroll scroll scroll!

New to the platform — responsive video

HTML code: &lt;video&gt;     &lt;source media=&quot;(min-width: 2000px)&quot; src=&quot;large.webm&quot; type=&quot;video/webm&quot;&gt;     &lt;source media=&quot;(min-width: 2000px)&quot; src=&quot;large.mp4&quot; type=&quot;video/mp4&quot;&gt;     &lt;source media=&quot;(min-width: 1000px)&quot; src=&quot;medium.webm&quot; type=&quot;video/webm&quot;&gt;     &lt;source media=&quot;(min-width: 1000px)&quot; src=&quot;medium.mp4&quot; type=&quot;video/mp4&quot;&gt;     &lt;source src=&quot;small.webm&quot; type=&quot;video/webm&quot;&gt;     &lt;source src=&quot;small.mp4&quot; type=&quot;video/mp4&quot;&gt; &lt;/video&gt;

Is not it bizarre that everyone talks in regards to the huge efficiency affect of poorly-sized pictures, and but it is fantastic that we do not have responsive movies on the internet?

Up till now! Firefox 120 shipped media characteristic give a boost to for movies. So did Chrome 120. And Webkit… they give a boost to media since eternally. Nice information for a leaner internet.

Scott Jehl defined (and partially applied) the brand new function.

Send the most productive video

You virtually made it to the tip!

I am surprised! You might wish to obtain the Internet Weekly E-newsletter each and every Monday, too?

3 precious initiatives to take a look at

QuickType UI showing how a JSON payload was transformed to TypeScript type definitions.

If you are searching for a handy guide a rough option to change into JSON payloads into TypeScript sorts, that is what quicktype does. ✨

Create the kinds

Cory LaViska mentioned using (meta) frameworks. 👏

On this business, you do not win via construction well-architected apps. You win via delivery rapid and transferring on.

Liked this e-mail? Hated this e-mail? I wish to pay attention about it!

For those who suppose there’s one thing that must be stepped forward or one thing that you simply loved, respond to this e-mail as a result of I wish to know extra!

And with that, care for your self – mentally, bodily, and emotionally.

I will see you subsequent week! 👋

[ad_2]

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back To Top
0
Would love your thoughts, please comment.x
()
x