Live data from Hacker News

Svelte is the most beautiful web framework I've seen

thefutureoftheweb.com

81–90 of 210 posts

Re: Svelte is the most beautiful web framework I've seen

#81

Earlier quoted context omitted.

I think your link is broken. What's the name of the video?

I'm assuming op was trying to link to this based off the timestamp https://www.youtube.com/watch?v=AdNJ3fydeao&t=1080

Thanks!

Re: Svelte is the most beautiful web framework I've seen

#82

I get a 500 error on the second page of the "getting started", so... nope, not the most beautiful I've seen.

Go directly to https://svelte-website-mrf26sti4q-uc.a.run.app/ and it works fine.

Someone posted a link to the Google Cloud Run issue above[1] that links to the non-vanity URL.

[1] https://issuetracker.google.com/issues/136539678

Re: Svelte is the most beautiful web framework I've seen

#83

Interesting that the custom element appears to just take a single JavaScript object as a parameter: In JSX this would be either: or: 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 be…

In Svelte,

  
Is just a shorthand for:

  
Spreading also works, although it's not nearly as used:

  
Boolean HTML attributes like "checked" can be used with boolean variables as-is:

  
  
I highly recommend anyone to go through the tutorial (at least once Google Cloud Run issues are solved) to get a feel of how things work together.

Re: Svelte is the most beautiful web framework I've seen

#85

Svelte looks really cool. Has anyone compared it in-depth to imba[0]? [0] http://imba.io/

I really like the demo video, you can select the code, scroll up and down, see different files. This is really neat!

Oh cool I didn't realize it was interactive. I'm pretty sure this is their scrimba platform[0], which is what they built imba for in the first place.

[0] https://scrimba.com/

Re: Svelte is the most beautiful web framework I've seen

#86

I have a table of 100 rows x 10 columns mostly of numbers which change 10 times a second (think trading). The source data sits in an array of objects. 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's css class too (from red it become blue for example). I'm using Vue/Bootstrap-Vue table at the moment, but it's quite slow.…

No matter which framework you describe, this is an iterative approach and will be inefficient. The optimized (or, at least faster) way to handle this would be to have a unique ID attached to a cell and offer a direct callback to it via the data. E.g. the symbol for "GOOG" stored in a hash table, when GOOG updates; call that hash directly: "symbols[symbol].update(data)" then re-render the cell DOM element.

Studying cracking the code interview at the moment and neat seeing this as is an actual use case for some of the array/hashmap interview questions.

Re: Svelte is the most beautiful web framework I've seen

#87
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.

Now I primarily use react. Vue looks great, but I don’t want to introduce yet another framework.

I could use some insights/view points from hn. I don’t feel using/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).

[1]: http://rivetsjs.com/

Re: Svelte is the most beautiful web framework I've seen

#88

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. Now I primarily use react. Vue looks great, but I don’t want to introduce yet another framework. I could use some insights/view points from hn. I don’t feel using/learning the now-abandoned frameworks is usele…

Same experience for me - rivets was great, very simple inside and the resulting applications were clean.

Re: Svelte is the most beautiful web framework I've seen

#89

I have a table of 100 rows x 10 columns mostly of numbers which change 10 times a second (think trading). The source data sits in an array of objects. 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's css class too (from red it become blue for example). I'm using Vue/Bootstrap-Vue table at the moment, but it's quite slow.…

At 10 times a second you might be hitting the browser’s table layout algorithm speed limits. I assume you’ve given it table-layout: fixed, and fixed-width columns?

That's a good point. Updating the table might be causing a reflow. Will that prevent updates from causing reflows?

Re: Svelte is the most beautiful web framework I've seen

#90
post #83

Interesting that the custom element appears to just take a single JavaScript object as a parameter: In JSX this would be either: or: 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 be…

In Svelte, Is just a shorthand for: Spreading also works, although it's not nearly as used: Boolean HTML attributes like "checked" can be used with boolean variables as-is: I highly recommend anyone to go through the tutorial (at least once Google Cloud Run issues are solved) to get a feel of how things work together.

Oh, I see. Looking further into the docs, I see that a JavaScript expression can be added inside an attribute string:

page {p}

https://svelte.dev/docs#Attributes_and_props

It seems like a neat design.

Post reply on HN