Closed manudeli closed 1 month ago
@Collection50 Could I assign you for this issue?
Before assign you, I want to get approval from other maintainers.
@gwansikk @kangju2000 @bigsaigon333 @SEOKKAMONI Check this new interface to expose
If we get approval, Let's make pull requests to do below.
<ClientOnly/>
, @manudeli Sure!
Before assign you, I want to get approval from other maintainers.
I agree, I think it is ready to be released.
I agree. Not only does the interface itself seem useful, but it also serves as a great example of using useSyncExternalStore
, providing developers with good ideas. Excellent work!
If we expose this component, I'm concerned that the meaning of the fallback prop might become ambiguous.
I'm worried that users might not immediately understand that this fallback is the UI shown on the server side. What do you think about this?
I agree with exposing this component!
But I think it would be better to either use a more explicit prop name or hide it.
I'm worried that users might not immediately understand that this fallback is the UI shown on the server side. What do you think about this?
Cool feedback! Thanks! @kangju2000
So I found dictionary to check what naming "fallback" means https://www.dictionary.com/browse/fallback
an act or instance of falling back. something or someone to turn or return to, especially for help or as an alternative: example: His teaching experience would be a fallback if the business failed.
For now, We are supporting fallback prop for Suspense, ErrorBoundary, Delay already. In my opinion, naming "fallback" was used for alternative ui for children's objective
<Suspense fallback={"alternative for not success of suspending"}>
{/* Guarantee success of suspending */}
</Suspense>
<ErrorBoundary fallback={"alternative for not no error"}>
{/* Guarantee no error */}
</ErrorBoundary>
<Delay fallback={"alternative for not delayed"}>
{/* Guarantee delayed */}
</Delay>
So, I thought "fallback" is good prop naming for ClientOnly (alternative for not client only environment). How do you think of this logic?
<ClientOnly fallback={"alternative for not client only environment"}>
{/* Guarantee client only environment */}
</ClientOnly>
I thought that we can use naming "fallback" for InView component too. Not perfect. but I thought that we can use naming "fallback" like this consistently
<InView fallback={"alternative for not client only environment"}>
{/* Guarantee in viewport or any element */}
</InView>
By this consistency, I thought fallback could be good common naming for these kind of cases
<Suspense suspending={"alternative for not success of suspending"}>
{/* Guarantee success of suspending */}
</Suspense>
<ErrorBoundary withError={"alternative for not no error"}>
{/* Guarantee no error */}
</ErrorBoundary>
<Delay delaying={"alternative for not delayed"}>
{/* Guarantee delayed */}
</Delay>
<ClientOnly server={"alternative for not client only environment"}>
{/* Guarantee client only environment */}
</ClientOnly>
<InView notInView={"alternative for not client only environment"}>
{/* Guarantee in viewport or any element */}
</InView>
@manudeli
Thank you for your response! I agree that maintaining consistency with other components is good. Additionally, it would be helpful for users if the prop explanations were included in the documentation.
it would be helpful for users if the prop explanations were included in the documentation.
Cool 👍
@bigsaigon333 re-alert you🙇
Inexplicit but Consistency: Good for me below, in my opinion
Consistency 🥇🥇🥇
@Collection50 Could you do this please?
@manudeli Sure!! 👍
@Collection50 Could you share your plan to do this?
@manudeli
I'll make it until 3pm!
@manudeli
- Add index file to expose.
- Write docs for ClientOnly
I'll make it until 3pm!
Thanks! We follow convention that public api should be in src/[publicApi].tsx (because of tsup setting's entry field) So move src/components/ClientOnly.tsx -> src/ClientOnly.tsx please.
I assigned you. Thanks for your contributing!
<ClientOnly/>
insrc/components/ClientOnly.tsx
to avoid tsup build entry.<ClientOnly/>
insrc/Suspense.tsx
. but Don't expose<ClientOnly/>
in index.ts yet. In my opinion, We should expose<ClientOnly/>
as public api gradually. so I think this should be next step.Originally posted by @manudeli in https://github.com/toss/suspensive/issues/528#issuecomment-2185584827