New: sharing state core concept!#934
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Awesome work! 🎉 Something I'm noticing is the "Jump when tab switch" due to a mismatch of content length between tabs. This leads to a jarring experience that, when I implemented it for my blog, lead to a lot of errant bug reports being filed. Here's a GIF of this in an extreme example: Screen.Recording.2022-06-19.At.2.41.02.Pm-1.mp4To fix this, I effectively:
Here's a PR that I wrote to fix this problem: |
yanthomasdev
left a comment
There was a problem hiding this comment.
Amazing work Ben "Tabs" H! I left a few suggestions for you 🙌
I also verified the Tabs component accessibility with NVDA and it is perfect for me 👌
|
This looks great! I did notice that on mobile (android firefox) some of the tabs overflow off the page and you can't scroll them to see the cut off content. |
natemoo-re
left a comment
There was a problem hiding this comment.
Looking great! Two small suggestions, neither blocking.
|
@zadeviggers horizontal scrolling added! |
|
@zadeviggers Also added a callout on solid stores for shared state. Let me know if these instructions make sense! |
|
@crutchcorn addressed! |
|
Looks great @bholmesdev! |
|
Just a quick note before I check the sites I have queued up to read re: "using emoji as end punctuation".... BEN... I'm not sure this page fits in the "Core Concepts" section, and I'm leaning towards it belonging in "Features" rather than "Basics" (as the pages are structured now). I'm curious to hear others' thoughts on this. The material that Fred is drafting in #893 is more overall description/philosophy of principle, and not technical walkthroughs. "Basics" are (right now) for things that are inherent to understanding an Astro project: file structure, components, pages/routing etc. and "Features" (formerly "Guides") are "Things you'd expect a website to have/do, and here's how you'd do that in/with your Astro site." The Basics briefly show some essential code patterns, but the Features will demonstrate the code required to achieve ... a feature. This feels like the latter to me? Thoughts? |
|
I love the general idea of this! However, switching any of the tabs in the Netlify preview doesn't work on iOS Safari for me. |
|
It works well in iOS Safari now after your updates. Great job! |
|
Like @sarah11918 said, this is more of a Guide than a technical concept essential to the very core of Astro :) Place it with the other features in the sidebar, and we can experiment with renaming that heading to "Guides" if it makes more sense. |
delucis
left a comment
There was a problem hiding this comment.
Hey Ben! Well isn’t this fantab ulous! Thank you. Sorry it took me a while to get you a review.
I’ve mostly focused on the technical side of things as I’m sure Sarah will have things to say about the content, and I don’t want to overwhelm you with too many editors.
sarah11918
left a comment
There was a problem hiding this comment.
Whew! Ben! Sorry, this took a little long because besides just a proofreading edit, one thing I look closely for is internal consistency both within the page and within the Docs as a whole. And, this, while delightful, takes both a slightly different tone, and a different level of technical explanation than most other pages in the docs. So, it did also require a bit of double-checking for "comps" around the site... all while reading the comments in Discord, seeing the file update underneath me...
So, here are my thoughts! Thanks for being patient! And thanks as always for contributing to the docs.. and uniting so many people into one PR. It's great to see so many people get involved!
|
|
||
| "Typical" UI frameworks like React, Vue, or Svelte may encourage ["context" providers](https://reactjs.org/docs/context.html) for other components to consume. But when [partially hydrating components](/en/core-concepts/framework-components/#hydrating-interactive-components) within Astro or Markdown, you cannot use these context wrappers 😳 | ||
|
|
||
| We'll need a different solution to create shared stores your components can read and write from: [**nanostores**](https://github.com/nanostores/nanostores). |
There was a problem hiding this comment.
| We'll need a different solution to create shared stores your components can read and write from: [**nanostores**](https://github.com/nanostores/nanostores). | |
| We'll need a different solution to create shared stores your components can read from and write to: [**nanostores**](https://github.com/nanostores/nanostores). |
nit: prepositions
Also, this does somewhat frame nanostores as the solution (even though you back off on that below).
An alternative, if you cared, is: "Astro suggests a different solution to ..."
Then, the question "Why nanostores?" flows well, as if to answer, "Why does Astro recommend that?". The list of alternatives following that again fits with Astro "suggesting" but not requiring, and demonstrating other options.
There was a problem hiding this comment.
Updated to the clearer: "Astro recommends a different solution for shared client-side storage"
| </Fragment> | ||
| </UIFrameworkTabs> | ||
|
|
||
| Now, you should have a fully interactive ecommerce example with the smallest JS bundle in the galaxy 🚀 |
There was a problem hiding this comment.
AP style guide says "e-commerce." Shopify, WordPress and Amazon use ecommerce. ... in our Astro vs X page we say eCommerce... 🤪
I'm OK with ecommerce, and will make a note to update elsewhere. Just wanted it to be known that I checked, for the record!
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
This reverts commit 65e15d9.
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
8061f18 to
e175c1b
Compare
|
Thanks for fi-NIT-shing this off, Ben! Friday merge, FTW! 🥳 |
|
Were Alpine stores considered? May we add comparison/examples with them? |
What kind of changes does this PR include?
Description
TabsPreact component for tab views across our docs. This includes:UIFrameworkTabsutility component for easily embedding UI framework comparisonsTabscomponent for any tab view you could want, based on slotsLoopingVideo.astroutility for video embedssharing-state-docs.mov