16 Matching Annotations
- Aug 2021
-
stackoverflow.com stackoverflow.com
-
const list = ['a', 'b', 'c'] as const; // TS3.4 syntax type NeededUnionType = typeof list[number]; // 'a'|'b'|'c';
-
- Oct 2020
-
www.npmjs.com www.npmjs.comhyperx2
-
This module is similar to JSX, but provided as a standards-compliant ES6 tagged template string function.
-
tagged template string virtual dom builder
-
-
github.com github.com
-
render(html`<${Button} on:click=${() => (clicked += 1)}>Click Me!<//>`)
Compared to https://github.com/kenoxa/svelte-jsx#api, this alows on:click instead of on_click.
So maybe this syntax allows for fewer workarounds overall?
-
-
-
github.com github.com
-
svelte-htm - Hyperscript Tagged Markup for svelte; a jsx-like syntax using Tagged Templates
-
-
-
by using tagged templates we can inline function calls
(below)
-
-
2ality.com 2ality.com
-
trusktr herman willems • 2 years ago Haha. Maybe React should focus on a template-string syntax and follow standards (and provide options for pre-compiling in Webpack, etc).
-
To suggest template literals cover the level of abstraction that JSX has to offer is just dumb. They're great and all, but c'mon now...
-
-
facebook.github.io facebook.github.io
-
However, this would lead to further divergence. Tooling that is built around the assumptions imposed by template literals wouldn't work. It would undermine the meaning of template literals. It would be necessary to define how JSX behaves within the rest of the ECMAScript grammar within the template literal anyway.
-
Template literals work well for long embedded DSLs. Unfortunately the syntax noise is substantial when you exit in and out of embedded arbitrary ECMAScript expressions with identifiers in scope.
-
ECMAScript 6th Edition (ECMA-262) introduces template literals which are intended to be used for embedding DSL in ECMAScript.
-
Why not Template Literals?
Tags
- javascript: tagged template literals
- substantial
- developer's intention
- syntax noise
- JSX
- assumptions
- non-standard
- DSL
- design goals
- leverage the fact that tooling already exists
- good point
- ECMAScript standard
- intended use/purpose
- good question
- controversial
- embedding
- benefiting from shared tooling that can be reused
- exceptions to the rule
- divergence
- undermine
- verbose/noisy
- why not?
Annotators
URL
-
-
-
Don't think so; template strings solve the problem JSX tries to tackle without forking the language.
-
-
github.com github.com
-
Solid supports templating in 3 forms JSX, Tagged Template Literals, and Solid's HyperScript variant.
-
- Dec 2016
-
developer.mozilla.org developer.mozilla.org
-
You use literals to represent values in JavaScript. These are fixed values, not variables, that you literally provide in your script.
Literals are fixed values hard-coded in.
-