News for hackers. Stuff that matters.
Re:State of JavaScript 2020 by milkers on Friday January 15, 2021 @06:59PM (#25798311)
Some takeaways of mine;

- Typescript keeps strengthening its position as industry standard.

- Svelte is hyped, but is it battle tested enough?

- Testing Library is quite new in the town but already the runner up testing tool.

- In terms of data management, GraphQL holds its position on the top while good-ol Redux kept losing interest.

What are yours?

Re:State of JavaScript 2020 by Pfhreak on Friday January 15, 2021 @07:02PM (#25798333)
I've seen Svelte used in a number of high impact tools, including in AAA videogame UI. In my experience, I've seen engineers very happy working with it, and it meets the performance needs for a videogame it should be good enough for the web.
Re:State of JavaScript 2020 by mattdesl on Saturday January 16, 2021 @03:00AM (#25800848)
I’m also working with Svelte for my (non-AAA) game, and enjoying it thoroughly. The only problem I find is that complex animations/transitions can get a little messy (compared to say GSAP timelines), and it tends to create a lot of garbage out of the box so some tuning is necessary to avoid GC thrashing.
Re:State of JavaScript 2020 by ha4fsd3fas on Friday January 15, 2021 @07:06PM (#25798382)
Do you have any info on that AAA game? I would be curious to read up on how/why they used svelte.
Re:State of JavaScript 2020 by preommr on Friday January 15, 2021 @08:38PM (#25799059)
> including in AAA videogame UI

elaborate, please, because this sounds so bizarre.

Are they bundling an entire web view and then interfacing it with their game engine? Not only is the tech conceptually weird, I can't think of too many AAA games that have very complex UIs other than maybe the CK series.

Re:State of JavaScript 2020 by turtlebits on Saturday January 16, 2021 @12:17AM (#25800254)
A lot of games have storefronts for DLC. I've seen these used as webviews, especially payment forms.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:22AM (#25802741)
Yes, it was two Svelte apps. One for the menus and one for the in game ui/hud elements. Things like health bars, reticles, ability timers, etc.

The interface between the game engine was designed to be as decoupled as possible. The UI could run in a browser with a mocked game underneath it, which allowed the UI devs to iterate very quickly. This also has the advantage of allowing UI to be built before the game had a feature implemented.

Re:State of JavaScript 2020 by Macha on Saturday January 16, 2021 @09:04AM (#25802198)
It doesn't surprise me. 5 years ago the standard solution was Scaleform, which is pretty much the same thing but with Flash.
Re:State of JavaScript 2020 by vbezhenar on Saturday January 16, 2021 @09:06AM (#25802211)
It might be for main menu. I think that WC3 reforged used webview for its menu.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:23AM (#25802748)
Main menu but also in game UI. Ability timers, weapon reticles, health bars, etc.
Re:State of JavaScript 2020 by Macha on Saturday January 16, 2021 @09:10AM (#25802228)
I would wager that a middle of the road data-heavy web UI actually asks more of their framework performance wise than a video game UI. Compare the number of interactable elements in e.g. a Trello board to a FPS weapon loadout screen. Sure, the consequences of a sluggish UI in a video game can be worse than a sluggish UI in a web app if it's running on the main thread and blocking the game's execution, but plenty of games update their UI less than once a frame, or run it in a separate thread altogether.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:25AM (#25802761)
Possibly. It's not just the loadouts though. Reticles and health bars need to animate at least 30 fps if not 60.
Re:State of JavaScript 2020 by davidwparker on Saturday January 16, 2021 @11:14AM (#25803158)
Svelte is hard to get passed the hype until you build a reasonable size project with it.

Personal anecdote/plug: I built https://www.listenaddict.com/ last year with Svelte. It's medium-ish sized (majority of the app is the moderator and administrator pages). It's extremely fast to develop (and will only be faster with SvelteKit+Snowpack). It's trivial to implement components and stores make state management a breeze.

Having done React for ~4 years, and some Vue projects, I won't be going back to those anytime soon.

That said, it's not without its own issues, but anything I've had issues with I've been able to solve relatively quickly or have someone within the community help.

Re:State of JavaScript 2020 by tjchear on Saturday January 16, 2021 @11:13PM (#25808044)
Looking to jump into Svelte and would appreciate your opinion.

What did Svelte do better than react and vue that you won't go back to them anytime soon?

Re:State of JavaScript 2020 by williamdclt on Saturday January 16, 2021 @09:24AM (#25802310)
> Testing Library is quite new in the town but already the runner up testing tool

We've been using Enzyme for a few years at my company. Very recently a new guy introduced testing-library, and oh my god it is so much better.

For one thing, it actually allows to render component on react-native (Enzyme's `mount` doesn't work for some reason) and that's reason enough for me to switch.

Re:State of JavaScript 2020 by jtdev on Saturday January 16, 2021 @09:21AM (#25802291)
> “In terms of data management, GraphQL holds its position on the top while good-ol Redux kept losing interest.”

Not sure what you mean by “data management” here, but fetch/REST seem like to most predominant, simple, ubiquitous means of handling external data.

Re:State of JavaScript 2020 by _nalply on Saturday January 16, 2021 @11:11AM (#25803131)
When I read that I immediately thought about GraphQL subscriptions. I don't know whether this will a bottleneck, but perhaps it makes sense to route everything through GraphQL, this means: someone updates via GraphQL and everybody listening gets an event by subscriptions.
Re:State of JavaScript 2020 by sevencolors on Friday January 15, 2021 @07:37PM (#25798636)
> - Svelte is hyped, but is it battle tested enough?

Try asking the NYTimes how it's working out for them

Re:State of JavaScript 2020 by milkers on Friday January 15, 2021 @07:52PM (#25798751)
First, I hate paywalled news sites. Second it sounds more like inbreed than a battle thanks to reddit friends.

`The creator of Svelte, Rich Harris, actually works there!`

`I think it was a passion project from a web dev at NYT`

I would still like to hear more about it, will dig further, thanks.