-
Notifications
You must be signed in to change notification settings - Fork 16
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
Resource Reform #112
Merged
Merged
Resource Reform #112
Conversation
This file contains 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
Run & review this pull request in StackBlitz Codeflow. |
Child resources is the last bit. To be continued!
Since we're going to use Sync as the primitive under Resource, this commit beefs up and thoroughly tests child Syncs.
This is a first stab at the implementation. I think that using primitive sync features would make the code more straightforward, so I plan to do that before finalizing this PR.
getServiceFormula is a low-level API that renderers can use to synchronize all services together with the root component (or equivalent).
NullVoxPopuli
force-pushed
the
feature/resources-refresh
branch
from
September 5, 2023 20:46
8bd259a
to
921ceb7
Compare
Child resources is the last bit. To be continued!
Since we're going to use Sync as the primitive under Resource, this commit beefs up and thoroughly tests child Syncs.
This is a first stab at the implementation. I think that using primitive sync features would make the code more straightforward, so I plan to do that before finalizing this PR.
getServiceFormula is a low-level API that renderers can use to synchronize all services together with the root component (or equivalent).
…feature/resources-refresh
React testing library assumes that `act` is available in testing, but it's not available in prod. For now, disable the React prod tests to land resource reform. We'll hopefully re-enable the tests soon, but it will require finding a strategy for writing generic acceptance tests in React that work both in development and production mode.
wycats
force-pushed
the
feature/resources-refresh
branch
from
September 22, 2023 20:06
26ec114
to
dc3844f
Compare
This is an old test in @starbeam/runtime that has been moved to @starbeam/debug *and* updated to guard against production mode (because description APIs are intended to produce `undefined` in production builds).
Open
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.
This is an in-progress pull request that reforms the resource implementation.
Its primary purpose is to separate out the setup phase (the code that runs on initial render that sets up the resource's state) from the synchronization phase (the code that runs outside of the render phase and synchronizes external state with reactive state).
It creates a new low-level primitive:
SyncTo
. ASyncTo
represents code that runs in thesync
phase, which corresponds to a framework's structured phase for synchronizing reactive state with external stores. For example, it would correspond to the code inuseEffect
in React.This pull request also formalizes the separation between the setup phase (which runs once per component lifetime), the render phase (which runs once per top-level render, including re-render), and the sync phase (which runs during external store synchronization).
Finally, this pull request also retools the lifetime system to be more aligned with JavaScript's Stage 3 Explicit Resource Management API. It's a rather significant internal change, but from a user-facing perspective, it creates the concept of an active Finalization Scope that supplements the existing concept of an active Tracking Frame.
Current status:
@starbeam/shared
SyncTo
Description
infrastructure54 failing tests)Follow-ups:
@starbeam/shared