-
Notifications
You must be signed in to change notification settings - Fork 841
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
fix(EuiPageTemplate): replace CSS.escape
usage with string replace to fix SSR support
#7525
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to fix SSR support when `CSS` utils are unavailable
tkajtoch
force-pushed
the
fix/ssr-css-escape
branch
from
February 12, 2024 16:04
6f913dd
to
a917692
Compare
Preview staging links for this PR:
|
💚 Build Succeeded
cc @tkajtoch |
cee-chen
approved these changes
Feb 12, 2024
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.
Perfection!
jbudz
pushed a commit
to elastic/kibana
that referenced
this pull request
Feb 23, 2024
`v93.1.1`⏩ `v93.2.0` --- - Updated `EuiPageSidebar` and `EuiPageTemplate.Sidebar` with a new `hasEmbellish` prop (defaults to false) ([#7521](elastic/eui#7521)) - Added `diff` glyph to `EuiIcon` ([#7520](elastic/eui#7520)) - Added `newChat` glyph to `EuiIcon` ([#7524](elastic/eui#7524)) **Bug fixes** - Fixed `EuiSideNav` not correctly typing the `items` prop as required ([#7521](elastic/eui#7521)) - Fixed the `CSS is not defined` bug in `EuiPageTemplate` when rendering in some SSR environments, particularly Next.js v13 and up ([#7525](elastic/eui#7525)) - Fixed `EuiDataGrid` component to clean up timer from side effect on unmount ([#7534](elastic/eui#7534)) **Accessibility** - Fixed `EuiSideNav` to render a fallback aria-label on mobile toggles if no heading or mobile title exists ([#7521](elastic/eui#7521)) **CSS-in-JS conversions** - Converted `EuiSideNav` to Emotion; Removed the following Sass variables: ([#7521](elastic/eui#7521)) - `$euiSideNavEmphasizedBackgroundColor` - `$euiSideNavRootTextcolor` - `$euiSideNavBranchTextcolor` - `$euiSideNavSelectedTextcolor` - `$euiSideNavDisabledTextcolor` - Removed the `euiSideNavEmbellish` Sass mixin. Use the new `EuiPageSidebar` `hasEmbellish` prop instead ([#7521](elastic/eui#7521)) - Added a new memoization/performance optimization utility for CSS-in-JS styles ([#7529](elastic/eui#7529))
semd
pushed a commit
to semd/kibana
that referenced
this pull request
Mar 4, 2024
`v93.1.1`⏩ `v93.2.0` --- - Updated `EuiPageSidebar` and `EuiPageTemplate.Sidebar` with a new `hasEmbellish` prop (defaults to false) ([elastic#7521](elastic/eui#7521)) - Added `diff` glyph to `EuiIcon` ([elastic#7520](elastic/eui#7520)) - Added `newChat` glyph to `EuiIcon` ([elastic#7524](elastic/eui#7524)) **Bug fixes** - Fixed `EuiSideNav` not correctly typing the `items` prop as required ([elastic#7521](elastic/eui#7521)) - Fixed the `CSS is not defined` bug in `EuiPageTemplate` when rendering in some SSR environments, particularly Next.js v13 and up ([elastic#7525](elastic/eui#7525)) - Fixed `EuiDataGrid` component to clean up timer from side effect on unmount ([elastic#7534](elastic/eui#7534)) **Accessibility** - Fixed `EuiSideNav` to render a fallback aria-label on mobile toggles if no heading or mobile title exists ([elastic#7521](elastic/eui#7521)) **CSS-in-JS conversions** - Converted `EuiSideNav` to Emotion; Removed the following Sass variables: ([elastic#7521](elastic/eui#7521)) - `$euiSideNavEmphasizedBackgroundColor` - `$euiSideNavRootTextcolor` - `$euiSideNavBranchTextcolor` - `$euiSideNavSelectedTextcolor` - `$euiSideNavDisabledTextcolor` - Removed the `euiSideNavEmbellish` Sass mixin. Use the new `EuiPageSidebar` `hasEmbellish` prop instead ([elastic#7521](elastic/eui#7521)) - Added a new memoization/performance optimization utility for CSS-in-JS styles ([elastic#7529](elastic/eui#7529))
fkanout
pushed a commit
to fkanout/kibana
that referenced
this pull request
Mar 4, 2024
`v93.1.1`⏩ `v93.2.0` --- - Updated `EuiPageSidebar` and `EuiPageTemplate.Sidebar` with a new `hasEmbellish` prop (defaults to false) ([elastic#7521](elastic/eui#7521)) - Added `diff` glyph to `EuiIcon` ([elastic#7520](elastic/eui#7520)) - Added `newChat` glyph to `EuiIcon` ([elastic#7524](elastic/eui#7524)) **Bug fixes** - Fixed `EuiSideNav` not correctly typing the `items` prop as required ([elastic#7521](elastic/eui#7521)) - Fixed the `CSS is not defined` bug in `EuiPageTemplate` when rendering in some SSR environments, particularly Next.js v13 and up ([elastic#7525](elastic/eui#7525)) - Fixed `EuiDataGrid` component to clean up timer from side effect on unmount ([elastic#7534](elastic/eui#7534)) **Accessibility** - Fixed `EuiSideNav` to render a fallback aria-label on mobile toggles if no heading or mobile title exists ([elastic#7521](elastic/eui#7521)) **CSS-in-JS conversions** - Converted `EuiSideNav` to Emotion; Removed the following Sass variables: ([elastic#7521](elastic/eui#7521)) - `$euiSideNavEmphasizedBackgroundColor` - `$euiSideNavRootTextcolor` - `$euiSideNavBranchTextcolor` - `$euiSideNavSelectedTextcolor` - `$euiSideNavDisabledTextcolor` - Removed the `euiSideNavEmbellish` Sass mixin. Use the new `EuiPageSidebar` `hasEmbellish` prop instead ([elastic#7521](elastic/eui#7521)) - Added a new memoization/performance optimization utility for CSS-in-JS styles ([elastic#7529](elastic/eui#7529))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Some SSR environments (e.g., Next.js) don't provide the
CSS
utilities object, and the currently usedCSS.escape
static function is undefined.This PR replaces the
CSS.escape
usage with a regular string replace. TheuseGeneratedHtmlId
usesReact.useId
that may return a string containing colons, and these will now be escaped with the\
character.QA
General checklist