Live data from Hacker News

Introduction to Svelte

daveceddia.com

71–80 of 116 posts

Re: Introduction to Svelte

#71
post #37

I like reading scientific papers and most examples sections provide rich and intricate outlines of real-life use-cases where the idea can be experimented against. These examples usually involve quite complicated scenarios that "put the idea to the test". One that I recently read involved a solution to the "Challenge Problem" [1] (simulating the movement of a rover) which involves lots of interesting properties and al…

And bundle size always comes first for some reason...

This new Bladderbuster framework is amazing because it compiles to negative KB. It has zero features and is really slow but negative KB!

Re: Introduction to Svelte

#72
post #5

I loved Svelte a few years back and still think it's a nice framework with cool ideas. However, a big issue for me using it at a company is that testing (especially unit testing) seems to be an afterthought. This has made it a non-starter for using it with multiple teams working on same code base. Maybe it's changed with Svelte 3 but a library I wrote for it wasn't clear how to test. (Edit sounds same: https://github…

Is there any UI framework where testing isn't an afterthought?

Angular really shines here, I feel. I really like protractor, and you can integrate it really easy with puppeteer (via expect-puppeteer or karma-chrome-launder with the option headless)

Re: Introduction to Svelte

#73
post #38

"Another nice thing: the node_modules folder for this Hello World Svelte app totals only 29MB and 242 packages." How is it nice that you have almost 30MB of code for something that prints "Hello World"? EDIT: For what it's worth, I don't fault Svelte for this necessarily. This is indicative of NPM bloat which is becoming rampant in my opinion.

What in that app's node_modules folder do you consider to be necessary bloat?

Re: Introduction to Svelte

#74
post #64

Earlier quoted context omitted.

I said in my opinion. I think going from JSX to templates is a bad idea and going back to where we were.

What exactly JSX offers what templating does not?

JSX is JavaScript. I do not have to learn a new language to iterate over an array. I can interact with it using whatever JS libraries I prefer. JSX components are functions or classes which are trivially composable. I can type functions and classes with typescript unlike string templates.

Re: Introduction to Svelte

#75
We need someone to take Svelte on a test drive for something more complex than a to-do list. I'm assuming the results will be favorable to svelte, but please blog after said exercise. The un-ending list of blogs and tutorials on to-do lists with svelte are certainly plentiful, repetitive, and not particularly convincing

Re: Introduction to Svelte

#76
post #36

This looks nice. I'm not a framework guy (more on that in a second) but they at least seem to be heading in the direction of letting me get work done without forcing me to do it their way. That said; first it was Backbone which wasn't terrible but kinda clunky in my opinion. But then Angular came along and everybody rushed over to that pasture. But then React came along and everybody rushed over to that pasture. Now…

tl;dr watch this fantastic intro to svelte talk by it's creator: https://www.youtube.com/watch?v=AdNJ3fydeao , it covers some of the growing pains of React that svelte addresses. While it might look like the frontend is going around in circles, there are major & minor differences between the technologies, and they have each introduced novel (to JS at least) things... Off the top of my head (this timeline might not be…

Great summary!

For reference, the blog post that you're thinking of is "The More Things Change" [0], which compares React + Flux to a Win32 `WndProc` function. Original HN comments for that thread are at [1].

[0] https://www.bitquabit.com/post/the-more-things-change/

[1] https://news.ycombinator.com/item?id=10381015

Re: Introduction to Svelte

#77

We need someone to take Svelte on a test drive for something more complex than a to-do list. I'm assuming the results will be favorable to svelte, but please blog after said exercise. The un-ending list of blogs and tutorials on to-do lists with svelte are certainly plentiful, repetitive, and not particularly convincing

While I'm still in the wait-and-see stage of evaluating Svelte, Pinafore [1] is a relatively big app build using it. It also identified highlights to some extent why wait-and-see is still a good approach for non-spare time apps: it's still on v2 because the upgrade to v3 was rather significant.

It's probably good to let the API and the tooling stabilise some more, especially since the latter includes a full-blown compiler and hence also has to replace Babel, as far as I'm aware (which is not too far) - and TypeScript, for that matter.

[1] https://pinafore.social/

Re: Introduction to Svelte

#78
post #64

Earlier quoted context omitted.

What exactly JSX offers what templating does not?

JSX is JavaScript. I do not have to learn a new language to iterate over an array. I can interact with it using whatever JS libraries I prefer. JSX components are functions or classes which are trivially composable. I can type functions and classes with typescript unlike string templates.

[deleted]

Re: Introduction to Svelte

#79
post #38

"Another nice thing: the node_modules folder for this Hello World Svelte app totals only 29MB and 242 packages." How is it nice that you have almost 30MB of code for something that prints "Hello World"? EDIT: For what it's worth, I don't fault Svelte for this necessarily. This is indicative of NPM bloat which is becoming rampant in my opinion.

LOL. I am actually laughing here at this comment. 30 bloody meg. Never mind ageism in tech, this sort of thing will give me a heart attack before I'm halfway through my career. :D

If you think of js bundle size as a percentage of average hard drive space or compare to a ratio of broadband speeds then 30 megs doesn't seem so bad.

Re: Introduction to Svelte

#80
post #13
post #12

The article says that items = items.filter(i => i !== item); is compiled to $$invalidate('items', items = items.filter(i => i !== item)); So this invalidates the whole array, right? Would this then re-render the whole array, i.e., remove and recreate all DOM nodes? And if so, does Svelte support more fine-grained ways to update arrays?

The TL;DR is that Svelte overpromises. They can't possibly write code for every transformation combination as code size would grow exponentially (I'm not completely sure, but I think predicting transforms would involve the halting problem). (thanks to whoever bothered to do this writeup). https://github.com/gactjs/gact/blob/master/docs/long-live-th... EDIT: if anyone has proof this is not true, I'd love to hear their…

You’re welcome :)

There’s more discussion here:https://mobile.twitter.com/Shub7241/status/11570049077753241....

Post reply on HN