Hacker Newsnew | past | comments | ask | show | jobs | submit | more yuchi's commentslogin

And only very malformed URNs may be actually valid URLs


RFC 3986 ("Uniform Resource Identifier (URI): Generic Syntax") has a wider definition of URNs, according to which URLs and URNs are not disjoint.

https://www.rfc-editor.org/rfc/rfc3986.html#section-1.1.3


I think a custom renderer for react would much more powerful. Currently JSX is just used as syntax sugar. Wasn’t some react ink project that more or less made this?


It’s not terribly difficult to make your own React renderer, and it’s fun to have full control.

I’ve written a React renderer that has both a canvas path for graphics and an automatically generated acceleration path for video layers:

https://www.daily.co/blog/new-beta-dailys-video-component-sy...

It’s open source, the code is here:

https://github.com/daily-co/daily-vcs


By a custom renderer, are you referring to replacing the rendering process (e.g. ReactDOM) rather than replacing JSX?

It's not clear to me how this would be better than swapping out the @jsx pragma. For rendering content to the Canvas, we have no need for all the overhead and complexity of React elements/components. There is no need or benefit in using the `React.createElement` (or its newer counterparts) to create React elements. But in theory, you're right that CanvaSX could have used React elements and rendered those instead of replacing the JSX pragma.


In the era of DOM documents (see notion, gitbook) I very often resort to attributed strings to do magic stuff with text parsing and manipulation. It’s such an elegant structure and I don’t understand why is so unknown.

Incredible article btw


Do you have an example? I’d love to learn more!


Let’s say you have a rich text where you want to highlight all occurrences of some token or syntax. When you have tree data structures you cannot use regexps or a simple parsers, since the full text may be split in different nodes.

With attributes strings it’s trivial, you just need to move attributes accordingly and to normalize stuff at the end.


I wonder if there are any web rich text editor components that use attributed strings? Tired of the DOM.


Thank you!


The UI breaks pretty easily with a “zalgo” amount of diacritics.

That said, very interesting. A cool tool to have in your belt.


By definition, no. Use strict was a subset of JS.


Ah, I see. So they could have at least excluded "==".


The adage is that if we didn’t die of age we would simply not cross the street, the odds may look slim in our short lifespan, but if you extend those to a thousand years getting hit becomes a facto of when, not if


It might go the other way: people would become more reckless beyond a certain age because they wouldn’t want to live for centuries.


Some people would but that wouldn’t be the norm.


Per day? I intrpreted the number as 6–11 cups “in the last year”.


How can 11 cups per year be classified as an "addiction"? That's less than 1 per month! Something doesn't make sense here.


Local DNS cache?


Yeah I forgot to clear this, thanks!


You can see that issues’ numbers are through the roof.


By definition, no. JSX is syntax sugar to some underlying function that transforms a JSX element (made by tagName, props, children) into something else. That could be a string, but usually it produces an abstract node representation, an object that collects those three parts.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: