solidjs-community / solid-transition-group

SolidJS components for applying animations when children elements enter or leave the DOM.
https://solid-transition-group.netlify.app
MIT License
254 stars 14 forks source link

feature request: better documentation #23

Closed illiaChaban closed 1 year ago

illiaChaban commented 1 year ago

Thank you for creating this library! I have used it many times and it's really nice. That being said I think the documentation could use a bit of work. I still don't understand the order of classNames applied and when to use which. I usually stick to onEnter/ onExit... methods, but it's also unclear what "done" method does. When I get it working, it takes a ton of trial and error

Based on my experience when "done' is called in the onExit phase, that's when the exiting element is actually removed, unless "done" from the onEnter phase called first (race condition of animations), then "done" from onEnter phase is what removes exiting element

It would be nice if the lib had some JSDOC comments for ease of reference. In fact, I think most of solid libraries could use JSDOC and I think there even might be a way to generate frontend documentation from JSDOC comments to keep then in sync

Bersaelor commented 1 year ago

For me, a few more examples of how it's intended to be used would be great.

How do you use onEnter/ onExit exactly, for example?

Maybe we should start an examples page somewhere.

thetarnav commented 1 year ago

Hey, I've recently updated the readme with some of the missing information and the jsdoc comments mirror what you'll find there.

I think there even might be a way to generate frontend documentation from JSDOC comments to keep then in sync

PRs with improvements and potential experiments around generating/syncing information between the two are very welcome :)

Maybe we should start an examples page somewhere.

That is a good idea. I've already set up a little Astro playground for local development, but it could be turned into a deployed website with examples given some love.

I'm going to close this issue for now as this is more of an open-ended task: the docs could always be better. You can open more specific issues for things to focus on next.