On yak shaving and <md-block>, a new HTML element for Markdown
lea.verou.me
lea.verou.me
I'm curious how this would work with SSR. I noticed that nothing appears in the spaces where these elements are used when I have NoScript blocking scripts on the page. Obviously this would prevent execution of web components, but are these written in such a way that it would be practical to prerender the content and the client-side code to replace or rehydrate them?
Web Components can't be SSR'ed. (The libs that claim to do so, cheat).
view-source:https://md-block.verou.me/
Nice and clean.
That being said I've never used web components and haven't really planned on. Not sure what their status has been in terms of adoption.
Chrome teams and WC proponents will have you believe the adoption is huge, in the tens of percents of webviews. Of which most are Google's Youtube...
There have also been high profile adoptions at GitHub and Salesforce.
Beyond that, they have an issue list as long as my hand (and busy adding new issues), and can't really be used without a library/framework. So...
It's fairly well adopted in many tools
Though I'm not sure exactly why you're comparing it to a custom element that renders Markdown.
"Shave enough yak to yeet a yurt".
Snappy yaks yeet yurts yonder.
It's either a nice alliterative run, or pedantic completeness, boss.
This website lags while I scroll on mobile.
I remember when the internet used to be fast and responsive. Probably just getting old.
It's possible that it's a combination of:
- it's known that iPhone and mobile Safari prioritize user interaction over display fidelity. So Safari prioritizes scrolling over rendering updates, and updates whatever's lagging at more infrequent intervals
- Safari implements CSS var updates differently (see https://news.ycombinator.com/item?id=29353136 on what's going on with the site)
Also all of the parsers for md are very complicated.
https://github.com/executablebooks/myst-parser :
> MyST is a rich and extensible flavor of Markdown meant for technical documentation and publishing.
> MyST is a flavor of markdown that is designed for simplicity, flexibility, and extensibility. This repository serves as the reference implementation of MyST Markdown, as well as a collection of tools to support working with MyST in Python and Sphinx. It contains an extended CommonMark-compliant parser using markdown-it-py, as well as a Sphinx extension that allows you to write MyST Markdown in Sphinx.
https://github.com/executablebooks/markdown-it-py :
> Follows the CommonMark spec for baseline parsing; Configurable syntax: you can add new rules and even replace existing ones; Pluggable: Adds syntax extensions to extend the parser (see the plugin list), High speed (see our benchmarking tests) ; Safe by default
https://github.com/markdown-it/markdown-it :
> Follows the CommonMark spec + adds syntax extensions & sugar (URL autolinking, typographer), Configurable syntax!; You can add new rules and even replace existing ones; High speed; Safe by default; Community-written plugins and other packages on npm
There's a media query consuming this variable, and doing a calculation:
--logo-y: calc(3em - var(--scrolltop, 0) * 1px);
So every time the user scrolls, TWO variable updates take place, TWO redraws, and TWO of these calculations take place, TWO more redraws, just to center the sunburst background on the logo.
This has got to be the most hackneyed comment on HN, and has been for the 10 years I’ve been on here.
It's better to be right than stylish...
You're basically pointing to the first panel and saying 'job done'. That's not enough to make it work.
I remember scrolling on an unaccelerated SVGA card and watching the screen repaint.
I remember being impressed at how gopher would only redraw the parts of the screen that changed, making browsing gopherspace bearable at 1200bps.
I remember queuing downloads of shareware games over zmodem and waiting an hour or more to find out whether they would even run on my hardware, and having to go do something else while I wait because my OS couldn't do multitasking and even if it could it would drop bits because the 8250 UART didn't have a buffer.
Do you remember it being that on mobile?
Because I remember when it used to be a tiny subset of HTML (remember WAP? or early "web" browsers for mobile?) that to add insult to injury still sucked donkeys' balls on mobile, being slow and unresponsive as hell.
That’s kinda what’s happening here, isn’t it? Document is shipped in markdown; Component renders it.
In a way I wish websites would ship raw Markdown without the ability to style much: Reader mode by default, that’s what the web should have been. But alas.