Re:Deno Joins TC39
by jerrygoyal on Monday December 13, 2021 @08:11AM
(#29539229)
As modern JS is getting closer to typescript in terms of new methods, latest syntax etc. What is the future of TS? will it be there for just type checking?
[ Parent
| on HN ]
Re:Deno Joins TC39
by lucacasonato on Monday December 13, 2021 @08:12AM
(#29539236)
Yes.
could you imagine that some JS proposal adds the ability to ignore TS-like type annotations to the engines, so we don't even have to strip them?
this may help development heavily, also making the browser and deno nearly identical environments.
Re:Deno Joins TC39
by lucacasonato on Monday December 13, 2021 @09:26AM
(#29539831)
Yes, this would be great, and it will probably happen eventually. This is something we want to work on soon - expect something in the coming weeks.
Since TS/Deno has native support for JSX syntax, do you think Browsers will eventually support it as well?
Re:Deno Joins TC39
by lucacasonato on Monday December 13, 2021 @12:06PM
(#29541549)
No, I don't think so. JSX is too proprietary and not specified well enough. It is also rather ambiguous.
If you want a "no compile" JSX:
```jsx
const x = <div color="red">hello</div>;
// is the same as
const x = h("div", { color: "red" }, "hello");
```
Re:Deno Joins TC39
by eyelidlessness on Monday December 13, 2021 @12:48PM
(#29542102)
This is more true as a mental model/to the type system, but slightly more complicated when compiled.
First, there’s the “new JSX transform”, which involves auto-imports, has a different function signature, and defines fallback behavior for certain circumstances.
Second, JSX is only specified as a syntax extension. Some implementations—like SolidJS and its underlying dom-expressions compiler—don’t compile to hyperscript at all.