Open samal-rasmussen opened 8 months ago
Also is this concept completely obsolete in Svelte 5? Can I just close this issue as obsolete? :)
It's not obsolete 😃 Probably makes sense to have some kind of component life cycle section, where this can be termed.
I just realized that Li Hau Tan's book starts with explaining the Svelte lifecycle phases in great detail. There are four lifecycle phases according to Li: Initialising, Mounting, Updating, and Destroying. At the very least the docs need need to say this.
Describe the problem
The concept of "component initialisation" is mentioned several times in the docs, but it is never explained what it is.
Mentioned several times on this page: https://github.com/sveltejs/svelte/blob/main/documentation/docs/03-runtime/01-svelte.md
And one time here: https://svelte.dev/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values
I've been thinking over this and haven't come up with a clean one sentence explanation or else I would have jumped right to a PR. Opening this bug report because this concept deserves a little introduction in the docs before being used repeatedly.
Li Hau Tan has a long explanation of youtube: https://www.youtube.com/watch?v=PI54YD4GsCc
Describe the proposed solution
Add a short concise explanation of what component initialisation is to the docs.
Importance
would make my life easier