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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Svelte is the most beautiful web framework I've seen

334 点作者 bhalp1将近 6 年前

22 条评论

beardedman将近 6 年前
Let the &quot;soap box brigade&quot; commence!<p>I got introduced to Rich Harris via a podcast (not personally), but am a big fan of his perspective on JS. I think we can all agree that; if you don&#x27;t like Svelte, then fine. If you love JSX&#x2F;TSX - then great! If you&#x27;re a Vue person, then awesome - its exactly what makes this community great - the diversity &amp; innovation. Not the soap-boxing antics, polarised opinions &amp; vilification of opinions that aren&#x27;t congruent with your own.<p>As someone much wiser than me once said - &quot;always bet on Javascript&quot;.
评论 #20338464 未加载
评论 #20340340 未加载
评论 #20338724 未加载
caiocaiocaio将近 6 年前
I like playing with different web frameworks, but the article had a bad hype:information ratio, so I googled the Svelte homepage, which I think is really well presented: <a href="https:&#x2F;&#x2F;svelte.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;svelte.dev&#x2F;</a>
评论 #20336717 未加载
评论 #20336834 未加载
评论 #20335968 未加载
评论 #20336739 未加载
CharlesW将近 6 年前
I watched Rich Harris&#x27;s &quot;Rethinking reactivity&quot; presentation (<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=AdNJ3fydeao" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=AdNJ3fydeao</a>) and was incredibly impressed.<p>Has anyone with React&#x2F;Vue experience used Svelte for a significant project? I&#x27;d love to hear about your experience with it.
评论 #20336774 未加载
tthisk将近 6 年前
The idea behind svelte is neat, i wonder though what the impact of its approach will be on a developers ability to understand what is happening under the hood. In my experience opaque abstraction layers can really hamper your ability to properly understand what is going on. Traditionally the JS ecosystem has been a frontrunner in this area (e.g. sourcemaps). But I have had terrible experiences in the Java ecosystem, with all its aspect weaving and annotation magic.
评论 #20336901 未加载
fasterdom将近 6 年前
I have a table of 100 rows x 10 columns mostly of numbers which change 10 times a second (think trading).<p>The source data sits in an array of objects.<p>On each update, I need to update the table cells with the latest values from the source array. The content of each cell can change, possibly it&#x27;s css class too (from red it become blue for example).<p>I&#x27;m using Vue&#x2F;Bootstrap-Vue table at the moment, but it&#x27;s quite slow.<p>Is Svelte suitable for this? Other options to quickly update a &lt;table&gt; from data in an array of objects, one object per row?
评论 #20339500 未加载
评论 #20336506 未加载
评论 #20336634 未加载
评论 #20336638 未加载
评论 #20338070 未加载
评论 #20336791 未加载
评论 #20340836 未加载
评论 #20337964 未加载
评论 #20338629 未加载
评论 #20339311 未加载
评论 #20340672 未加载
评论 #20336373 未加载
评论 #20336534 未加载
评论 #20336521 未加载
评论 #20337574 未加载
评论 #20337138 未加载
评论 #20336621 未加载
langitbiru将近 6 年前
So I just read about &quot;Choosing Boring Technology&quot; before coming into this thread. I guess React.js is the boring technology (already 5-6 years) one and Svelte is the new and exiting one! :)
评论 #20339269 未加载
评论 #20343608 未加载
评论 #20383046 未加载
评论 #20340769 未加载
评论 #20338763 未加载
s_y_n_t_a_x将近 6 年前
My main gripes are no TypeScript support and going to mustache-like templates after working with JSX&#x2F;TSX is a step back for me.<p>Also losing React Native, which is non-issue if you&#x27;re just developing a web app.
评论 #20335834 未加载
评论 #20341159 未加载
knubie将近 6 年前
There was a really interesting discussion recently in r&#x2F;Clojure about Svelte, and how its ideas relate to and can be translated to Clojurescript.<p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Clojure&#x2F;comments&#x2F;bqh0z4&#x2F;virtual_dom_is_pure_overhead&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Clojure&#x2F;comments&#x2F;bqh0z4&#x2F;virtual_dom...</a>
pkstn将近 6 年前
Also try RE:DOM, very close to Svelte but RE:DOM does not need a compiler and is faster than Svelte:<p><a href="https:&#x2F;&#x2F;redom.js.org" rel="nofollow">https:&#x2F;&#x2F;redom.js.org</a><p><a href="https:&#x2F;&#x2F;rawgit.com&#x2F;krausest&#x2F;js-framework-benchmark&#x2F;master&#x2F;webdriver-ts-results&#x2F;table.html" rel="nofollow">https:&#x2F;&#x2F;rawgit.com&#x2F;krausest&#x2F;js-framework-benchmark&#x2F;master&#x2F;we...</a>
hamilton将近 6 年前
As someone who has built a number of data products w&#x2F; React, I decided to give Svelte a try a few months ago. At this point I am using it on some internal projects to great success &amp; ease and probably wouldn&#x27;t go back to React for newer projects unless there was a compelling reason to (eg collaboration w&#x2F; other React devs). As a disclaimer, I admire the React community + devs and think React has made a lot of hard things much, much easier.<p>A few unvarnished takeaways from a data science &#x2F; viz point of view that I was thinking of writing up, but will use HN as a sketchpad:<p>1. I don&#x27;t really miss the React 3rd party ecosystem as much as I thought I would. Since most of what I do is data viz &#x2F; data presentations, I really just need a few d3 helper functions, and most other things I can build myself w&#x2F; svelte&#x27;s affordances. The biggest downside, however, is that there aren&#x27;t any good accessible UX component libraries for Svelte, so I have built my own. This all said, I&#x27;m productively code-homesteading and I love it. Animating component lifecycles, component style scoping, and state management are 1st-class citizens, so these pieces are pretty high-quality, usable, and thoughtfully built.<p>2. my &quot;time to first meaningful render&quot; metric was at an all-time low with Svelte. Getting started on a new idea or project is far, far easier than w&#x2F; any React project I&#x27;ve ever done. Substantially less boilerplate means I can get much, much more done in the same amount of time. I feel this every time I jump back into the React projects I work on &amp; maintain.<p>3. as my apps have grown in complexity, I&#x27;ve found that Svelte really holds up beautifully. The style&#x2F;layout&#x2F;behavior colocation strategy keeps the cognitive overhead of working on all the parts of multiple components to a minimum. The performance gains of Svelte, even with complex components and interactions, feels magical. Bundle sizes are bizarrely small.<p>4. as someone who feels CSS will absolutely outlive all of these frameworks, I think the design of Svelte really feels like the best of both worlds. And that&#x27;s how it should be – css + markup should be first-class citizens.<p>5. the testing story isn&#x27;t fully there yet, so I would say to that end, proceed with caution. I typically try to compartmentalize JS logic from presentation as much as possible, but perhaps you don&#x27;t.<p>6. the reactivity parts shine everywhere and are fairly easy to reason about in all cases, but they REALLY shine when you&#x27;re building complex visualizations.<p>7. this is an important one to me – building something in Svelte really tickles the same part of the pleasure centers of the brain that JQuery did for a previous generation (and d3 did for early data scientists). You just SEE the thing work, effortlessly, at a low cognitive cost, and everything fits together so nicely. I often start svelte-powered experiments and end with a great, reusable component. I think there is a large group of engineers who remember the JQuery days and sat out the React era because it just seemed like way too much to do simple things. I think Svelte is especially for them.<p>In sum, really highly recommended to at least try it. I wanted to find evidence to discount Svelte, but haven&#x27;t found any at this point, despite my best efforts. There is probably a certain class of dev that should be trying it – one without a ton of organizational constraints, probably. But if you do data science and want to level up your data presentation skills, you should be using Svelte imo.
评论 #20339187 未加载
anderspitman将近 6 年前
Svelte looks really cool. Has anyone compared it in-depth to imba[0]?<p>[0] <a href="http:&#x2F;&#x2F;imba.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;imba.io&#x2F;</a>
评论 #20337209 未加载
prashnts将近 6 年前
It does look great. I’m concerned though, few years ago I used to use rivets [1] for two-way data binding in html. It worked very well. Unfortunately, it’s abandoned. Same fate as coffeescript, backbonejs, etc.<p>Now I primarily use react. Vue looks great, but I don’t want to introduce yet another framework.<p>I could use some insights&#x2F;view points from hn. I don’t feel using&#x2F;learning the now-abandoned frameworks is useless though — the things I built are still working. But good luck to anyone who’d want to maintain that codebase (unlikely in my case).<p>[1]: <a href="http:&#x2F;&#x2F;rivetsjs.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;rivetsjs.com&#x2F;</a>
评论 #20337583 未加载
评论 #20347497 未加载
评论 #20337460 未加载
benatkin将近 6 年前
Interesting that the custom element appears to just take a single JavaScript object as a parameter:<p><pre><code> &lt;Board {game} &#x2F;&gt; </code></pre> In JSX this would be either:<p><pre><code> &lt;Board game={game} &#x2F;&gt; </code></pre> or:<p><pre><code> &lt;Board {...{game}} &#x2F;&gt; </code></pre> This is almost as ergonomic as JSX except for attributes like checked where the value is omitted. It might encourage some refactoring, compared with React, because the thought of putting attributes in a variable and adding them as a spread might occur more often when seeing an object being passed in.<p>At any rate, I recommend looking at the code example linked in the post, or watching the video. Otherwise the post is pretty low in information, as the top comment at the time of writing this suggested. <a href="https:&#x2F;&#x2F;github.com&#x2F;jesseskinner&#x2F;svelte-tic-tac-toe" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jesseskinner&#x2F;svelte-tic-tac-toe</a>
评论 #20337194 未加载
评论 #20336929 未加载
mvolkmann将近 6 年前
If you want to get up to speed on Svelte quickly, read this! <a href="https:&#x2F;&#x2F;objectcomputing.com&#x2F;resources&#x2F;publications&#x2F;sett&#x2F;july-2019-web-dev-simplified-with-svelte" rel="nofollow">https:&#x2F;&#x2F;objectcomputing.com&#x2F;resources&#x2F;publications&#x2F;sett&#x2F;july...</a>
Layvier将近 6 年前
How would it scale for a bigger app ? Shipping a library with the app like react creates poor performance for small components for sure, but abstractions must become worth it beyond a certain scale no ? I guess the compiler could also create abstractions when it becomes worth using them ?
评论 #20339729 未加载
评论 #20337058 未加载
atrilumen将近 6 年前
Man, I keep thinking &quot;just keep on chugging with Choo&quot;, but I&#x27;m really tempted by Svelte.<p>( <a href="https:&#x2F;&#x2F;choo.io" rel="nofollow">https:&#x2F;&#x2F;choo.io</a> )
AliAdams将近 6 年前
If you are getting a 404 trying to view the main Svelte site (<a href="https:&#x2F;&#x2F;svelte.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;svelte.dev&#x2F;</a>), there seems to be an intermittent issue with Google Cloud Run.<p>You can view the site directly at the uglier url: <a href="https:&#x2F;&#x2F;svelte-website-mrf26sti4q-uc.a.run.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;svelte-website-mrf26sti4q-uc.a.run.app&#x2F;</a>
larvaetron将近 6 年前
It&#x27;s kind of funny that the styling example is literally just plain-old CSS and HTML, not sure if that was intentional?
marcus_holmes将近 6 年前
I get a 500 error on the second page of the &quot;getting started&quot;, so... nope, not the most beautiful I&#x27;ve seen.
评论 #20336115 未加载
评论 #20337180 未加载
评论 #20336108 未加载
评论 #20335962 未加载
zaiste将近 6 年前
Svelte is strikingly similar to Marko.js [1] which predates it by few good years I believe.<p>Sadly the latter is still under the radar despite bringing in many interesting innovations to the space: its server-side approach being one of my favorite features.<p>[1]: <a href="https:&#x2F;&#x2F;markojs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;markojs.com&#x2F;</a>
jbverschoor将近 6 年前
This is not a web-framework. It is an frontend app framework for html&#x2F;javascript
评论 #20336728 未加载
评论 #20336604 未加载
bin0将近 6 年前
Svelte is so great... so were react, angular, ember, meteor, and vue. I&#x27;m sorry, but I&#x27;ve got trouble seeing how having one more framework to learn is going to help any thing.<p>There&#x27;s a webcomic of some sort to which I can&#x27;t find the link, which talks about this. Some one is sick of the bloat of x framework&#x2F;tool&#x2F;whatever, and decides to build it better. He works hard, and finally version 1.0 is released to dramatic music. But there&#x27;s a problem - it hits the real world and starts running into edge cases, bugs, and other things that can&#x27;t be predicted in design and testing, necessarily. Features creep, and over time, it becomes just as bad as that which it sought to replace. Then, some bright young soul gets the idea that he can do it better...<p>This is not to discourage innovation. It doesn&#x27;t appear it&#x27;s been battle-tested like other frameworks, and I don&#x27;t see many major operations on the list of users. If it ends up better, great, but I can&#x27;t say I&#x27;m optimistic.
评论 #20336005 未加载
评论 #20336216 未加载
评论 #20336254 未加载
评论 #20336159 未加载