Skip to content
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

[TRACKING] ViewComponent documentation site #505

Closed
6 tasks done
joelhawksley opened this issue Oct 15, 2020 · 14 comments
Closed
6 tasks done

[TRACKING] ViewComponent documentation site #505

joelhawksley opened this issue Oct 15, 2020 · 14 comments
Assignees
Labels

Comments

@joelhawksley
Copy link
Member

joelhawksley commented Oct 15, 2020

Summary

With Rails 6.1 on the horizon, the ViewComponent project will be under increased attention from the public.

This is a great opportunity for us to make the best first impression possible to the Rails community.

Let's level up our README into a documentation website we'll be proud of!

TODO

Open questions

@joelhawksley joelhawksley changed the title ViewComponent documentation site [TRACKING] ViewComponent documentation site Oct 15, 2020
@jaredcwhite
Copy link
Contributor

A few Ruby/Rails-aligned documentation sites I'll mention:

@joelhawksley
Copy link
Member Author

@jaredcwhite those are all fantastic examples!

I'm really impressed with the Bridgetown site. Would you be up for helping out with this project?

@jaredcwhite
Copy link
Contributor

@joelhawksley Well, if you don't mind using Bridgetown rather than Jekyll, I think it'd be pretty easy to clone the BT site and clear out the content and tweak the design for use here. You should be able to use GH actions to run the build process and deploy on pages here… slightly more inconvenient than using Jekyll directly, but not by a ton. (Bonus: you get Webpack for front-end assets as well that way…) Anyway, I could help out with all that if need be.

@g13ydson
Copy link
Contributor

g13ydson commented Nov 17, 2020

@joelhawksley I really like how things are organized using the gitbook + github integration. I created a documentation reorganizing some subjects by sessions. So, if it looks good, I can open a PR with the gitbook MD files.
https://g13ydson.gitbook.io/view-component-docs

@pinzonjulian
Copy link

I'm happy to help out writing any guides or docs!

PS: Love the gitbook site @g13ydson !

@joelhawksley
Copy link
Member Author

@g13ydson very cool! Would we still be able to host this on GitHub pages?

@g13ydson
Copy link
Contributor

g13ydson commented Nov 20, 2020

@joelhawksley with gitbook it is possible, but it takes more work. I decided to create with Jekyll. #529
DEMO: https://g13ydson.github.io/view_component_doc/

@joelhawksley
Copy link
Member Author

joelhawksley commented Dec 2, 2020

In https://www.youtube.com/watch?v=EQoJVFgZXo4, @maxshelley gave our docs a thorough read as a developer new to the project ❤️

Here are some improvements I think we should look into making based on his experience:

  • Add more detail regarding the form_for workaround. I think we can direct folks towards using the _tag helpers for now.
  • Provide a better example application experience than view-component-demo, which is out of date and lacks documentation.
  • Link to the PVC components and tests as examples.
  • Add documentation for the monkey patch.
  • Add a brief explanation for why ViewComponent is faster than partials.
  • Clarify that content is set by passing in a block, and doesn't need to be an argument in the component initializer.
  • Add documentation on how to generate a sidecar folder with the generator.
  • Clarify that render? is for whether the entire component is rendered or not.
  • Find a better way to explain what is accessible from the component template (instance variables and methods on the component object).

@Spone
Copy link
Collaborator

Spone commented Mar 26, 2021

I'm starting an evolving list of wanted improvements to the docs:

  • explain the use cases for variants, and how to use the feature in regular components
  • [...]

@joelhawksley
Copy link
Member Author

joelhawksley commented Apr 2, 2021

Some notes from #684:

  • Add a diagram like https://twitter.com/dan_abramov/status/981712092611989509/photo/1 to the Lifecycle page.
  • Add _after_compile to Lifecycle.
  • Look into higher-contrast syntax highlighting.
  • > I think we could put a really convincing example there showing off some of the features of view components as well as the value they provide. - @BlakeWilliams
  • Scale back sidecar assets page
  • Link to Gov.uk and bootstrap components in Resources

@joelhawksley
Copy link
Member Author

joelhawksley commented Apr 26, 2021

More notes from my RailsConf Q&A:

  • Add note for rendering view components outside of controllers and views (jobs, etc)
  • In what cases should we use VCs over partials? (No more partials)
  • How should VCs be organized and named? (Like controllers, namespaced, etc)
  • Have you experienced going back to your exisiting components and re-writing the interface as you use it on more cases?
  • How have y'all at Github approached testing view components that have an interactive component to them? We've mainly been unit testing each view component we add and then writing feature specs for browser interactions, but I'm wondering if there is a better way to approach it (System tests, cuprite)

@joelhawksley
Copy link
Member Author

I'm starting an evolving list of wanted improvements to the docs:

  • explain the use cases for variants, and how to use the feature in regular components
  • [...]

@Spone I've filed this in #898 ❤️

@joelhawksley
Copy link
Member Author

👋🏻 I've split this issue out into sub-issues 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants