-
Notifications
You must be signed in to change notification settings - Fork 2
support next 16 and segregate client/server logic #1042
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: FredrikHaraldseth <[email protected]>
| export interface MacroProps { | ||
| name: string; | ||
| children: string | React.ReactNode; | ||
| children: string | ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReactNode is already directly imported
| @@ -1,14 +1,15 @@ | |||
| import React, {Suspense} from 'react'; | |||
| import {Suspense, type ReactElement} from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import type directly to stay in line with existing code convention
| // need to display a placeholder if descriptor is empty as component is not initialized yet | ||
| if (descriptor && shouldShowPlaceholderView(meta)) { | ||
| // Server-side check | ||
| if (isComponentOutputEmptyOnServer(ComponentView)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Segregating checks to preserve RSC boundaries and avoid hydration mismatch
| expect(rootEl.outerHTML).toEqual(`<div id="text-root"> | ||
| <p>Some text before <a href="/base/url/no/some/link">the link</a> and some text after.</p> | ||
| <figure><a href="/base/url/no/some/image"><img src="/base/url/no/some/image.jpg" alt="Some image"></a><figcaption>Some caption</figcaption></figure> | ||
| <figure><a href="/base/url/no/some/image"><img alt="Some image" src="/base/url/no/some/image.jpg"></a><figcaption>Some caption</figcaption></figure> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of props is changed to pass tests
| "@edge-runtime/jest-environment": "^4.0.0", | ||
| "@enonic-types/core": "^7.15.4", | ||
| "@enonic/eslint-config": "^2.1.0", | ||
| "@testing-library/dom": "^10.4.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added dev dependencies to aid local development and testing
|
Closes #1006 |
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
(c) The contribution was provided directly to me by some other person who certified 1., 2. or 3. and I have not modified it.
(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
I adhere to these requirements by adding a Signed-off-by line to commit messages, using the same name and email address that are used in my Github profile.
Example: