-
Notifications
You must be signed in to change notification settings - Fork 88
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(core, react): Supports dynamic import for activities, and delays transition effects while loading an activity or waiting for a loader response #542
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 761b26d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
React.lazy()
to fetch an activity or when the loader is currently pending state. React.lazy()
to fetch an activity or when the loader is currently pending state.
React.lazy()
to fetch an activity or when the loader is currently pending state.
(참고) |
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.
I'm really appreciating your works for the tricky issue.
Here's a question:
Is PausedEvent
and ResumedEvent
allowed to be made by the 3rd-party users working with the plugins other than the integrations?
If so, please consider adding the hook interfaces for the plugin. (onBeforePaused
, ...)
If not, hide those as internal events and block the event creation from calling dispatchEvent
.
@orionmiz I just finished reflecting your review, please review again. |
New Event (Core)
PausedEvent
andResumedEvent
to delay the effect of transitions.New Interface (React)
lazy(() => import(“...”))
, emit aPausedEvent
before importing the Activity and aResumedEvent
if the Activity is successfully imported or an error occurs.PausedEvent
before executing the loader and aResumedEvent
when the loader state resolves.Why does it have to be of the form
lazy(() => import(“...”))
?Other candidates considered
React.lazy
or not. To find out, we'd have to float it in the React environment, which we decided was an unnecessary overhead.Promise
or aReact.ReactNode
.Therefore, I introduced a new construct
lazy()
that allows to statically evaluate whether the currently passed argument requires lazy loading or not.