TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Impressions of React and TypeScript from an Elixir/Elm Developer

18 点作者 gampleman6 个月前

1 comment

CharlieDigital6 个月前
<p><pre><code> &gt; The contortions one has to go through to use setInterval (or resort to a custom hook), the very manual management of dependencies with useEffect, useCallback and the like, the repetitive verbosity of useState – all of it eventually adds up to a tedious experience.... </code></pre> Vue and Svelte are definitely better on this front.<p><pre><code> &gt; but it somehow ends up being the uncanny valley of functional programming </code></pre> Evan You has a great quote regarding this: <i>&quot;The pain and suffer of hooks all roots from the mismatch between a dogmatic belief in the superiority of immutability and the harsh reality of the host language that is JavaScript.&quot;</i><p>React, to extents, is fighting against the nature of JavaScript itself. The React team is on record acknowledging that signals are probably a more performant paradigm for updates, but preferring to &quot;pretend&quot; that components are stateless instead.<p><pre><code> &gt; However, I was in for an unpleasant surprise as I started checking out how to set it up and quickly realised that as of 2024, the backend tooling just wasn’t mature enough... </code></pre> One generally does not run TS on the server. Dev in TS and compile and ship in JS as always because the runtimes are actually all JS; TS is purely a dev time sanity check and can be, as the Svelte team has done, interchanged with other approaches like JSDoc. Microsoft&#x27;s type annotation proposal[0] would have been a nice &quot;bridge&quot;, but was universally derided. The tooling is actually quite good considering the cluster that is NPM and node_modules. Vite and the wider ecosystem that it pulls together is pretty amazing.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;tc39&#x2F;proposal-type-annotations">https:&#x2F;&#x2F;github.com&#x2F;tc39&#x2F;proposal-type-annotations</a>
评论 #42175655 未加载