-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Proposal: update browser check to look for document
#549
Comments
My progress toward supporting server-side rendering can be found in this PR: alexlafroscia/ember-emotion#16 Although I had to modify this line to check for emotion/packages/emotion/src/sheet.js Line 49 in 03023bb
|
I've identified two locations in the https://github.com/emotion-js/emotion/blob/master/packages/create-emotion/src/index.js#L315 https://github.com/emotion-js/emotion/blob/master/packages/create-emotion/src/utils.js#L74 I think that the first one referenced should import the I'm happy to make this PR myself, just want the go-ahead that you're interested in these changes and that there isn't some additional context around why checking only |
There's no special reason we check for |
Awesome! In that case, I’ll make a PR with my proposed changes. Thanks @mitchellhamilton |
@mitchellhamilton is there a timeline for when |
@alexlafroscia Just published |
woot! thank you! |
I've been working on an Ember compatibility library for
emotion
(ember-emotion
) and have been trying to get server-side rendering working by integrating with FastBoot. However, I've been having a bit of trouble because of the way thatemotion
checks for the browser environment.In FastBoot,
window
is defined butdocument
is not.emotion
checks forwindow
but then never uses it; it usesdocument
in a number of places to inject the styled into the page.Is there a reason for this? If not, would you be willing to accept a PR that checks for the presence of
document
instead, since that's the actual API thatemotion
depends on?If you'd like to maintain the check against
window
for browser-environment detection, would you be willing to explore the ability to inject the reference todocument
so that it could be overwritten in a case like mine wheredocument
isn't available?The text was updated successfully, but these errors were encountered: