This repository was archived by the owner on Jan 13, 2025. It is now read-only.
fix: server-side rendering errors in linear progress and slider - #5792
Merged
copybara-service[bot] merged 1 commit intoApr 9, 2020
Merged
Conversation
The linear progress and slider components were trying to access `window` as a global directly which will throw under Node environments. These changes add a `typeof` guard infront of it to avoid the error.
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 10, 2020
…progress bar I got some changes in with material-components/material-components-web#5792 which allow us to properly render a progress bar during server-side rendering, instead of turning it into a noop. These changes remove all of the `isBrowser` checks. I also removed the `isBrowser` check from the MDC checkbox, because the `offsetWidth` access is safe, even though the property might be undefined.
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 10, 2020
…progress bar I got some changes in with material-components/material-components-web#5792 which allow us to properly render a progress bar during server-side rendering, instead of turning it into a noop. These changes remove all of the `isBrowser` checks. I also removed the `isBrowser` check from the MDC checkbox, because the `offsetWidth` access is safe, even though the property might be undefined.
andrewseguin
pushed a commit
to angular/components
that referenced
this pull request
Apr 17, 2020
…progress bar (#19036) I got some changes in with material-components/material-components-web#5792 which allow us to properly render a progress bar during server-side rendering, instead of turning it into a noop. These changes remove all of the `isBrowser` checks. I also removed the `isBrowser` check from the MDC checkbox, because the `offsetWidth` access is safe, even though the property might be undefined.
andrewseguin
pushed a commit
to angular/components
that referenced
this pull request
Apr 17, 2020
…progress bar (#19036) I got some changes in with material-components/material-components-web#5792 which allow us to properly render a progress bar during server-side rendering, instead of turning it into a noop. These changes remove all of the `isBrowser` checks. I also removed the `isBrowser` check from the MDC checkbox, because the `offsetWidth` access is safe, even though the property might be undefined. (cherry picked from commit 5d25d1b)
soro-google
pushed a commit
to soro-google/components
that referenced
this pull request
Apr 24, 2020
…progress bar (angular#19036) I got some changes in with material-components/material-components-web#5792 which allow us to properly render a progress bar during server-side rendering, instead of turning it into a noop. These changes remove all of the `isBrowser` checks. I also removed the `isBrowser` check from the MDC checkbox, because the `offsetWidth` access is safe, even though the property might be undefined.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The linear progress and slider components were trying to access
windowas a global directly which will throw under Node environments. These changes add atypeofguard infront of it to avoid the error.Note: ideally
getCorrectPropertyNameandgetCorrectEventNamewould get thewindowthemselves manually and would do thetypeofcheck internally, but it seems like thewindowObjparameter is used when unit testing and there's no nice way around it. Also changing the signature would be a breaking change.