Comparing Svelte and React
jackfranklin.co.uk
Comparing Svelte and React
1–10 of 338 posts
Re: Comparing Svelte and React
#2Svelte seems to be the pinnacle of the "bundling era" of frontend frameworks.
What do you think comes next?
XYZ-to-WASM?
Back the roots with (non-)bundlers like Skypack?
Anyone heard of next-gen experiments in that directions?
Re: Comparing Svelte and React
#3My only complaint is that the Typescript support isn't quite perfect yet, but it's already very functional.
Re: Comparing Svelte and React
#4It's easy to use but it adds 55kB gzip to your project.
https://bundlephobia.com/result?p=@firebase/auth@0.16.4
A couple of comments on the Svelte code.
1) It doesn't makes much sense to use onMount() with listenForAuthChanges(). Just modify the currentUser writable whenever onAuthStateChanged() has an update. Now simply import and use $currentUser in your components.
2) You don't need to use currentUser.subscribe() from your .svelte files as you can use the reactive $: notation for this. You can, if it makes more sense to you, but I wouldn't say it's idiomatic.
Re: Comparing Svelte and React
#5Can anyone recommend good, easy-to-integrate alternatives?
Re: Comparing Svelte and React
#6onMount(() => { return listenForAuthChanges() })
and
onMount(() => listenForAuthChanges())
?
Re: Comparing Svelte and React
#7Javascript n00b question... is there any difference between onMount(() => { return listenForAuthChanges() }) and onMount(() => listenForAuthChanges()) ?
Re: Comparing Svelte and React
#8Javascript n00b question... is there any difference between onMount(() => { return listenForAuthChanges() }) and onMount(() => listenForAuthChanges()) ?
Re: Comparing Svelte and React
#9> I love Firebase Authentication, it's such an easy way to add auth to side projects. It's easy to use but it adds 55kB gzip to your project. https://bundlephobia.com/result?p=@firebase/auth@0.16.4 A couple of comments on the Svelte code. 1) It doesn't makes much sense to use onMount() with listenForAuthChanges(). Just modify the currentUser writable whenever onAuthStateChanged() has an update. Now simply import and…
For Firebase, will ES modules help with code splitting? The new Svelte kit framework is built by Vite (runs on ES build underneath).
Re: Comparing Svelte and React
#10> I love Firebase Authentication, it's such an easy way to add auth to side projects. It's easy to use but it adds 55kB gzip to your project. https://bundlephobia.com/result?p=@firebase/auth@0.16.4 A couple of comments on the Svelte code. 1) It doesn't makes much sense to use onMount() with listenForAuthChanges(). Just modify the currentUser writable whenever onAuthStateChanged() has an update. Now simply import and…
Re 1) Where should you put the code to initialize the SDK? Code that ideally should only be ran once in the entire lifecycle of the page. For Firebase, will ES modules help with code splitting? The new Svelte kit framework is built by Vite (runs on ES build underneath).
I also trigger init code from my entry point (eg: main.js).