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

[NoSSR] Port the component from legacy Base UI #593

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Sep 10, 2024

Took the NoSSR component from the legacy package, described and published it.

Preview: https://deploy-preview-593--base-ui.netlify.app/components/react-no-ssr/

@michaldudak michaldudak added new feature New feature or request component: NoSsr The React component labels Sep 10, 2024
@mui-bot
Copy link

mui-bot commented Sep 10, 2024

Netlify deploy preview

https://deploy-preview-593--base-ui.netlify.app/

Generated by 🚫 dangerJS against a8611c1

docs/data/components/no-ssr/FrameDeferring.tsx Outdated Show resolved Hide resolved
Comment on lines +44 to +45
namespace NoSsr {
export interface Props {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new pattern? How can people extend the NoSsr prop now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we decided to go with this pattern. See the rationale in #517. The interface should be extendable the same way as without the namespace.

@@ -1,6 +1,6 @@
---
productId: base-ui
title: No SSR React component
title: No-SSR React component
description: The No-SSR component defers the rendering of children components from the server to the client.
components: NoSsr
---
Copy link
Member

@oliviertassinari oliviertassinari Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use "No-SSR" below as well for the h1 of the docs page, no? It's uses "No SSR" right now.

SCR-20240919-sqrc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know which one is more correct TBH. @colmtuite, @atomiks, could you chime in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ClientOnly is a better name?

Copy link
Member

@oliviertassinari oliviertassinari Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client only as client bundle only or client side only? 😁

import { NoSsr } from '@base_ui/react/NoSsr';
import { Box } from '@mui/system';

export default function SimpleNoSsr() {
return (
<div>
Copy link
Member

@oliviertassinari oliviertassinari Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we freeze the height on these demos?

Suggested change
<div>
<Box sx={{ height: }}>

It layout shifts otherwise when loading the demo page. It's annoying, anchor links to ids below this demo don't work well.

</NoSsr>
</div>
);
}

const Panel = styled('div')`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I love how it makes the .preview much easier to follow.

@oliviertassinari
Copy link
Member

Related to #659

@michaldudak michaldudak mentioned this pull request Oct 1, 2024
14 tasks
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NoSsr The React component new feature New feature or request PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants