-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC][documentation] What do you think? #1799
Comments
Hi Josh, overall the docs have served me well and only gotten better over time. There are two things that would suggest though:
|
Let me tell you about my first experience with the react-spring docs. Around a year ago, I used/tried using react-spring for some micro-interactions in a page that I worked on. I was a bit overwhelmed by the docs at first, so I ended up copying examples onto the page. I specifically remember using this example. Once pasted into my project, the typescript linter went nuts. I had tons of type errors on the arguments passed into the useTransition hook. This felt very frustrating since I couldn't figure out what was wrong and the example was working in the CodeSandBox. Also, the documentation didn't tell anything about the usage with TypeScript. I believe the following ideas could benefit the documentation:
|
Hey! So first up let me says it's rare and amazing to see an open source project open up a conversation like this about docs. That already puts you way up in the 0.01% 😁 Regarding the imperative API page in particular - that stood out to me previously, because when I first use react-spring about 6 months ago I read that page, and I had never used a previous version so my reaction was "huh, why are they telling me about deprecated API that I've never seen?". It would be better to open with the current API and then have a final section "Upgrading from the old API". The actual docs content is pretty good I think, it's been a while since I read it in detail so I won't comment further. There are also many great demos, but they are kind of hidden by being placed at the bottom of each page. What I mean is, if I want to do something, say, create a cool card stack animation: Then I might remember seeing this demo in the docs somewhere. Right now I would have to remember "hmm, I think I would use The final thing I'd say is maybe make the header just a tiny bit smaller. When I click on a new page, with the site in full screen on a 4k monitor, what I see is this: Don't get me wrong, it's a lovely header. But if I'm in the docs I'm there for info, not pretty graphics. Maybe shrink the header down to 20% vh on all pages except the intro? |
Thanks for the feedback folks! I'll be taking a look at all this and hopefully filtering it all in, if you have anyone has additional feedback please continue to post it! |
Not crystal clear which Hook applies to which use case. Some of them sound very similar to each other. |
@stoico would you be able to give an example so I understand better please? |
Preface: I love react-spring and thank you for your work ❤️ Some common scenarios are, say:
Let's take for example point 1:
Added step:
It would be cool if it was possible to structure the Docs the other way around. A list of common animation scenarios and a solution that showcases how to do it. In a sense you could say the docs are backwards, what I am ultimately trying to do is reproduce an animation I have in mind. So, just as an idea to explore, what if the docs were job-to-be-done-centred rather than tech-centered: Maybe one more thing: I love the Codepens at the bottom of each page, most of them feel too advanced and an overkill for most situation. They don't provide a gradual learning experience, especially frustrating for First Time users. Adding simpler ones with a single component and one animation would help or where there already are a mix of advanced and simple ones, we could group them in: Easy, Medium, Hard difficulty. So that at each level of the learning journey they user knows immediately which one to investigate. What do you think? P.S. Interaction wise, I would also recommend making the website header's height a lot smaller everywhere (except the homepage maybe?). Every time I change doc page I need to scroll below the fold. When you're quickly looking up something and browsing lots of different pages to try and find what you need, it adds constant friction. |
One thing that I would hugely appreciate in the docs would be links to sandboxes with complete code. There are many examples in the docs, but there's seldom code that one could simply copy and paste, and it has many missing parts. For example the "You can transition array" example contains variables like |
Hi Josh. Thanks for your work on such a powerful amd fun library! One thing that I'd like to see is a little more detail into the under-the-hood-ness . I'm personally someone who likes to know a bit about how things are working behind the scenes, instead if being satisfied with following or copying code. To me react spring is a little bit too black-boxy because as a beginner developer I can't get much out of reading the source. So I think my suggestion would be just a little more detailed breakdown on how the hooks work under the hood. And perhaps also an explainer to the concept of "rendering outside of react' might be useful. |
Hello, Josh. - What didn't you like about the documentation? The organization of it. - What do you like about our documentation compared to others? The abundance of examples. - What other documentation sites do you like? (Doesn't have to be animation related) The docs for the framer framework and Vue are pretty good. |
This is great but I'm a PM not a Dev so mainly use these docs to find and reference the Demos which are hidden at bottom of the page. Then I hospital pass it over to my front-end developer to ask them what's possible to implement when updating/building a new feature. I would appreciate a nice video introduction or examples of developers actually using react-spring. It's a lovely library though. |
Hi, I am new to Web Development and to be honest, I could not find what I was looking for. I searched several places & thought 'react-spring' would be a good choice. However, I could not figure out with the documentation available. I thought Also, in this video https://www.youtube.com/watch?v=b3G7l7fHRP8 at ~5.30, he shows a webpage with a lot of examples. However, those examples are not available on the official page now. Please let me know if I am looking at this all wrong. Sorry if I sound harsh, that is not my intention. |
Please make doc links jump to the content so people don't have to scroll past the giant header (why is it on every page?) every time they navigate. |
Two mentions for improvements, since I just want to start using this and got difficulty already:
|
One "simple" thing to do, to improve the documentation by a factor of two : update all the example to the latest apis with latests standards. Then you will inevitably use/write/improve a "migrate from xx to ^9.0" guide for this task, so it's a good thing aswell. |
I think the docs are quite nice in terms of layout and structure. The library is so flexible which is of course a great thing, so finding what to use and when is not always straight-forward, but I'm new to spring as well, was using framer-motion a lot before. So I think if anything, more examples would be nice because you can always study those and learn more than just reading. One thing that is ruining a bit the experience with docs is the page scrolling to top every time a link is clicked. This should be a fairly simple thing to fix. The site is Next right so the link prop scroll could be set to false, this could be an issue because then you don't go to the top of the new section, so either the scrolling could be implemented manually, or alternatively the header could just be made less tall. Thanks for the great work on the lib. |
First of all, thank you for your great work on the library. I'm really happy to see this thread! I recently wanted to use React-Spring to recreate the winning animation from Wordle; I had a really hard time. Example wordle-animation.movDescription: 5 boxes; each box bounces up and then bounces back to where it began. There were broadly two things I struggled with
I struggled with the documentation for a few hours and ended up giving up because I couldn't get anywhere close, and none of the examples were helping me get closer. |
Sorry to hear you gave up @scottluptowski, you can reach me on Discord in the PMNDRS discord server – JumboJosh. But I also thank you for taking the time to feedback clearly with some really great questions that you had that I can then reflect on. To everyone else feeding back, I thank you all ⭐ |
That's all I have for now, I'll try to think of more. And when there is a consensus on direction, I'm more than happy to contribute PRs! |
+1 for clearer, simple uses cases. With all love, some of the examples are too clever by half, making it hard to clearly understand what's happening. |
Hi Joshua, I have spent the last two and a half days trying to make react-spring work for my needs. I am really struggling. Like seriously struggling. I shouldn't be struggling at all. I was among the earliest adopters of React. I have been doing JavaScript stuff for at least 13 years. Things like anime and Motion were a breeze for me. My biggest fear in writing this comment is it will hurt your feelings. You have put in so much incredible work. The very last thing I want is to make you think your effort is not counting. If I didn't see the promise, I would probably not bother sharing. So, for a start: your (and your co-contributors') technical skill is incredible! And thank you for showing the humility to ask for feedback. At this point, I think it is worth reflecting and addressing on the big issues of the moment. React-spring has the foundations of a library as successful in the future as Greensock. But for that to happen, and for another library to not just come in a few months and eat your cake, a lot of things need to change. Things like:
I have a lot of ideas for solving these issues. All in all, there is a major need for customer-centricity going forward. But putting my ideas in a corner of your issues section or in a channel on your discord feels like the best way for me to spend 5 hours not being useful in any way. If you would get on a call with me, we could discuss these details and give you a solid pathway forward that is easy to document. Without hearing your concerns to my issues, and without me being able to talk about them by showing you my code snippets, I am afraid I am admitting I wouldn't be able to be very helpful. This stuff can't be communicated in lengthy essays. Why I am invested: animations w/ React are going to be one of the key pieces of my job in the next year. Choosing the right tooling is not just nice-to-have; it will be critical to our product. I need to use every last feature of the library, given how extensive the use cases for me to address are. After evaluating several options, I ended up wanting to evaluate Thanks for your work and best wishes. Hope I did not offend you; I only intend to be useful. |
I think it is a little confusing design-wise. whenever I land on the website, I go directly to the first button thinking it would take to a "get started" or some (basics) guide, but instead it take the github discussion page. I think those three CTAs in the hero should be: Get Started, API, and Community or Source if you like. Also the guides section does not have a starter guide, like a guide to implement basic animated stuff The Basics PageThe page starts to become confusing from "Do not think of the values you pass as "styles" per se" as the examples used introduce so many parameters that have not been seen before: const [flip, set] = useState(false)
const { x } = useSpring({
reset: true,
reverse: flip,
from: { x: 0 },
x: 1,
delay: 200,
config: config.molasses,
onRest: () => set(!flip),
}) What happened to the The example could be something quite simple, using the snippets that have been seen before, to point to that we could animate arbitrary keys: const {fadeAnim} = useSpring({ from: { fadeAnim: 0 }, to: { fadeAnim: 1 } });
return <animated.div style={{opacity: fadeAnim}}>
I will fade in
</animated.div> |
Notes on this input:
Summary and suggestions:
Now to explaining myself: Look, I love the hunt, I spend days searching for the perfect anything, components, libraries, CSS-animations, fonts... But when I’ve entered the docs, the hunt is over, and I want to proceed to make things work. Since I have no prior experience with react-spring, I have no idea where to go, because I don’t know what I want to order from the menu presented to me. The flow, or dare I say, reluctant drizzle of the docs looks like this:
Thank you for caring and asking for feedback, that really stood out to me. |
I always forget where the Shorthand style props are. It seems like something that should be under API > Common > Props, but it's only under Basics. Also, it's really a pain seeing the full-page hero every time I change pages in the documentation. Users are basically forced to scroll down the full height of their screen before seeing anything substantive every time they change pages. (I've resorted to just using my ad blocker to hide the hero.) |
Apologies if this may have been stated in previous comments, but I do have two minor gripes and suggestions:
|
I started using this library recently. It's awesome, thank you! I was going over the Basics and got stuck for a while in the view interpolation section. I had to re-read it a couple of times before it really made sense, what helped was to concentrate more on the code. Making the Basics content more accessible would be great. I haven't gone over all of the docs, but maybe there are similar issues in other places. Again, thank you for this library! |
We got a site update shipped which skips the header on site navigation BTW. I've used these docs quite a bit now, and they're good docs - it's nice work. When I think about how to structure docs sites (I wrote the sites/docs for TypeScript, CocoaPods and Danger) I try to have three major sections + a REPL:
What I think would be really useful in learning the basic primitives with react-spring is a concrete showcase of adding animations to an existing app. #1799 (comment) mentioned Wordle, and that might be a simple enough example to start with. For example a tutorial that takes wordle, and incrementally adds animation to the game in key points in a way that echoes how someone would do so in production. That can take you through a few of the APIs, explain some of the nuance and then drop people off at places or examples to dig in further In terms of a REPL, I think the usage on codesandbox is pretty solid 👍🏻 - maybe there's space for something more tied to your site with sandpack though. |
Is there any way to view v8 API documentation? I couldn't find them any where. |
Please put a big link to demos (or examples) at the top of the landing page, |
These doc sites are good examples of good documentation: |
Thanks for the examples! What makes you think they're so good out of interest? The design? The content? The tone of voice? Etc. |
As someone relatively new to programming, I would LOVE if there were an implementation tutorial on using react-spring in react more holistically, rather than just completely isolated examples. Not necessarily a documentation issue for experienced devs, but for noobs like myself. Usually this is the space of youtube to cover, but I find tutorial content fairly sparse. Regardless, thank you greatly for your time and for a fantastic module! |
Things they have in common that I find that make the reading a better experience:
divio documentation has a nice take and what documentation is and how to structure it. |
One thing that I find annoying is that popup on the right bottom of the page showing up on any page change. Please remove it 🙏 |
Please please please add a search bar. If not, atleast put everything on one page so we can use cmd+F. It's a fustrating guessing game to find anything. No disrespect, just my honest, fustrated opinion. Thanks. |
Spring animations are like a holy grail for me. When I got my first iPhone I was mesmerised by being able to switch between screens with a fluid animation, or step-by-step by slowly sliding my finger across the screen. So when I first heard about react-spring I was obviously excited, but it's been a couple of years now and I still haven't grasped it. The docs seem simple enough at first glance, a couple of hooks with fairly straightforward parameters. But then when you want to start implementing I still feel like I don't know where to start. What hook do I need for this specific animation, do I animate the parent with a The next logical step is to have a look at the examples, but these are often built on outdated versions of react-spring in combination with I was looking at this Youtube video earlier which seems like a perfect candidate for As for how the documentation is organised it does not make a whole lot of sense to me to start with the I also feel like the language is sometimes more obscure than it should be. For example, when talking about properties that can be passed in to A final important one for me, documentation should have versions and remain available when new major versions are published as https://date-fns.org/ does it for example (although the version you're currently looking at could be a bit more apparent to the user as they have it tucked away in the corner). I do want to end with saying that the library itself is amazing and that this and framer motion have the potential to become the baseline for animating on the web. |
I was trying to use the What I would also appreciate is full code to the examples that are there on the API page. |
I had big trouble with understanding how can I pass styles from parent component useTransition to child component. Only thing I could find in existing documentation was this: https://react-spring.io/basics#finally-tie-the-animated-values-to-your-view. This wasn't very helpful because it didn't elaborate how to pass styles and how to type it. The second thing was that I had trouble understanding why useTransition and passing styles down to child component resulted in a lot of rerenders. Documentation did not provide much help. Finally I've stumbled upon this beautiful answer on SO https://stackoverflow.com/a/69780522/2607169 and linked codesandbox https://codesandbox.io/s/react-spring-elaborate-example-mn5pu which dives deep into explaining why this happened and how to fix it. |
Just wanted to say thank you everyone who gave feedback!! I've tried to take as much of it into account as possible, however some of it is better angled out the type and quality of our documentation as opposed to the design. I've drawn up some of the content items i'm trying to tackle here – https://github.com/pmndrs/react-spring/projects/3 Items might come & go. But i've done an MVP design implementation so when i've added the I'll be locking this issue after the beta is released. |
|
Great link! I'm actually in the middle of reading Docs for Developers, which discusses very similar practices and then a little bit more! Worth the read if anyone is interested in technical writing. |
Overall I like the documentation and the library as a whole, I will use it in my current and future projects.
Points is not defined. |
Just another vote, again, for removing the giant header on the docs pages. It's quite frustrating. |
you can stop repeating yourself, it's quite frustrating 😄 |
My apologies, didn't mean to frustrate with the feedback the site asks for every time I open it ¯_(ツ)_/¯ 😄 For what it's worth I wanted to put my money where my mouth is and submit a PR to fix it, but I ran into various NPM dependency issues and was unable to get it up and running. More than happy to help out. <3 |
You're welcome to get squarespace to sponsor this project and I'd be able to spend more time building the new docs 😊 P.S. did you try yarn? EDIT: Props to you! 🙇🏻♀️ |
Well I'm fairly far removed from engineering at Squarespace and am using this in a personal capacity, but I don't mind sponsoring it a bit myself actually. Probably not enough for anyone to quit their day job, but maybe enough to get a few cups of coffee for those late nights 😄 I did not try yarn, but I will now! |
Hi Everyone, Thank you again to everyone who's given feedback. I'm very happy to share the initial beta of the new docs site – https://beta.react-spring.dev/ As you'll no doubtably see, it is a WIP & I will be adding more documentation over the coming weeks most likely focussing on our component APIs (useTransition, useChain etc.). I think for now until the documentation is complete examples might take a back seat as I want to figure out the best way to display them in the site with filtering so people can find what they want as well as find the time to make some more "common use case" examples e.g. an slide-in panel! I'd love to get more feedback on the site particularly around any bugs you find or surrounding the content you're reading, since this issue is going to be locked, lets move it to it's own discussion thread – #1931 And if you really hate, don't tell me 😉 |
Problem
Preface
Whilst I think our documentation coverage is good, I think it can be hard to find what you want. The information architecture of the site isn't quite right. There are pieces of documentation we want to be shouting about e.g. our Imperative API but it's not really doing that.
Going forward
I don't think it's something i'll be able to solve in a day or two, it'll be a classic gradual re-write / shape / tweak. But I welcome contribution either in code or suggestions here. All suggestions will be taken into account, but realistically we can't implement everyone's opinion. It'll be about trying to get the clearest message.
Solution
How can you help?
To get me started, I need to understand the pain points!
My own thoughts
For transparency here's a few thoughts i've had:
examples
page, to show case all of them, they're hiding with the related component!algolia
is a thing, we should get on it!The text was updated successfully, but these errors were encountered: