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

feat(v2): add ExecutionEnvironment API #2296

Merged
merged 2 commits into from
Feb 19, 2020
Merged

feat(v2): add ExecutionEnvironment API #2296

merged 2 commits into from
Feb 19, 2020

Conversation

yangshun
Copy link
Contributor

@yangshun yangshun commented Feb 18, 2020

Motivation

Add a new client API to determine the current execution environment (whether on server or client). This helps to clean up some of our code where we do typeof window !== 'undefined'. Some users are facing SSR issues as well and this API could be used by them as well.

Also reorganized the client API docs and added categories.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 18, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Feb 18, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 7b98f04

https://deploy-preview-2296--docusaurus-2.netlify.com

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

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

LGTM although I would probably prefer to have a NoSSR component, see #2273 (comment)

@yangshun yangshun merged commit d974aa9 into master Feb 19, 2020
@yangshun yangshun deleted the exe-env branch February 19, 2020 01:22
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants