sveltejs / svelte

web development for the rest of us
https://svelte.dev
MIT License
80.1k stars 4.26k forks source link

developer docs #14230

Open benmccann opened 2 weeks ago

benmccann commented 2 weeks ago

Describe the problem

There are parts of Svelte I don't understand since the rewrite. This makes it harder for me to contribute, but mostly just harder for me to understand how Svelte interacts with SvelteKit, to have productive conversations with other maintainers, etc.

Describe the proposed solution

Write some basic developer documentation. If the only thing covered were the anchor comments I would be happy enough :smile: I'd really like to understand how hydration, dom creation, and transitions work and interact with those comments.

Importance

would make my life easier

Ocean-OS commented 1 week ago

Agreed, most of my knowledge of Svelte's internals has come from reading compiled outputs and skimming the source code, which probably isn't a good teacher in the long run.

dummdidumm commented 1 week ago

Since you're still new to the code base: what specifically would have helped you?

Ocean-OS commented 1 week ago

Probably more information about the compiler(particularly the HTMLx parser), and also some in depth info on the internals would help. For example, what the differences between the different effects (template_effect, user_effect) are, and also maybe some examples of the different internal functions, such as $.init, $.reset and $.pop. Another thing about effects that would be nice to know is how re-runs are batched. It would be nice to have actual documentation on the entire svelte/internal package, but I don't know how practical that is, considering how often it may change.

paoloricciuti commented 1 week ago

This is actually something I had the idea of doing for signals to solidify my knowledge of the reactivity system but I agree, having a general document would be fantastic.