-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Refactor API into new api package
#3543
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
Merged
Merged
Conversation
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
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
|
What's the |
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
reviewed
Oct 19, 2020
corinagum
suggested changes
Oct 19, 2020
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.
Just a few questions/comments.
Since this is P1, we should wait to merge until all P0s are in.
corinagum
approved these changes
Oct 26, 2020
86b7278 to
438de16
Compare
corinagum
reviewed
Oct 27, 2020
| <div className={errorBoxStyleSet}> | ||
| <div>{type}</div> | ||
| <pre>{error.stack}</pre> | ||
| {/* The callstack between production and development are different, thus, we should hide it for visual regression test */} |
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.
Suggested change
| {/* The callstack between production and development are different, thus, we should hide it for visual regression test */} | |
| {/* The callstack between production and development are different; therefore we should hide it for visual regression tests */} |
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.
Changelog Entry
Added
apipackage, to be reused on React Native component, in PR #3543 by @compulimcore->api->component(HTML-only) ->bundleapipackage. Some hooks are only available on the existingcomponentpackage, due to their platform dependency or coupling with visual components. For example, Web Worker, 2D canvas,useMicrophoneButton*are not available on theapipackagecomponentpackage due to their coupling with visual components or platform features. Some implementations, such as, card action middleware and activity grouping middleware, are available onapipackage. For example:componentpackage due to their coupling with their respective visual componentsimBack,messageBackandpostBackactions are available onapipackage, butcall,openUrland other platform-dependent actions are only available oncomponentpackageactivityMiddleware,attachmentMiddleware, etc, now support array for multiple middlewareDescription
This is for refactoring platform-neutral APIs into a new
apipackage, to be reused on React Native component.Design
Please see #3316 for design.
In general, platform-neutral code are being moved to
apipackage. Code that left on thecomponentpackage assumes it is running inside a web browser.We also improved error handling, because
<ErrorBox>is a visual component and is platform-dependent. We need to update the error boundary component and render<ErrorBox>differently on different platforms.Although both React and React Native should support
styleSet, the content could be fundamentally different. Thus,styleSetare not offered inapipackages, but incomponentand the futurenative-componentpackage.Specific Changes
apipackage, layered betweencoreandcomponentapipackageapipackageapipackageapipackage, while keeping some in thecomponentpackageimBack,messageBack, andpostBack, which are platform-neutral, are moved toapipackagecall,openUrl, and others, are left untouched in thecomponentpackageapipackageUserlandBoundaryto add error boundary to user components (e.g. components rendered via middleware)internalErrorBoxClassprop for internal useapipackage can pass their own React component (e.g.componentpackage running in development mode)apiwill render<ErrorBox>when error caught in error boundary, which in turn, will use theinternalErrorBoxClassto rendernode_env !== 'development),componentwill passundefinedtointernalErrorBoxClassand will hide the<ErrorBox>CHANGELOG.mdReview Checklist
Accessibility reviewed (tab order, content readability, alt text, color contrast)CSS styles reviewed (minimal rules, noz-index)Internationalization reviewed (strings, unit formatting)package.jsonandpackage-lock.jsonreviewedSecurity reviewed (no data URIs, check for nonce leak)