-
Notifications
You must be signed in to change notification settings - Fork 6
virtual bi-stable proxy for dependent scoped atoms #93
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
Open
dmaskasky
wants to merge
39
commits into
main
Choose a base branch
from
11-17_transactional-readatomstate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,025
−1,330
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
9bd633e to
7cd1176
Compare
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
6bfab5f to
21df872
Compare
350f2a7 to
aace9e1
Compare
- Add dependent WeakMap to scope for tracking dependent atoms - Add isScoped, isExplicit, isImplicit functions to Scope type - Add isDerived and isCustomWrite utility functions to utils.ts - Refactor scope.ts to use isDerived and isCustomWrite utilities - Remove inline defaultRead and defaultWrite checks in favor of centralized utilities
…dependents get processed before their proxy and in the wrong store.
…andles all classification changes. we corrected the reclassification process. the dependent test is getting pretty far along (see below). we also identified another edge-case where a scoped atom could have only unscoped dependencies but that differ from the original atom.
left todo: we need to finish fixing this test. we have to start thinking about inherited dependents and inherited dependencies. that might mean bringing implicit dependencies into the fold. we also have to add back the throw logic for async case. there is still a lot of cleanup to be done. My gut is we could reduce the code size by 50% when all is done. we are currently around ~650 lines. Stay focused on the goal! You're getting there, just keep chipping away. You have to keep this up until its done. Goal: derived atoms can flip between unscoped and dependent and inheritance works properly.
a: v=scoped_2
b: v=1
c: v=1
a: v=scoped_2
b: v=1
b@S1: v=2
- _c@S1: v=2
+ _c@S1: v=0
- c@S1: v=2
+ c@S1: v=0
a: v=scoped_2
b@S1: v=2
- c@S1: v=2
+ c@S1: v=0
a: v=scoped_2
b@S1: v=2
❯ tests/ScopeProvider/dependent.test.ts:136:32
134|
135| s1.set(c, 2) // c1 is dependent scoped – so it writes to b1
136| expect(printAtomState(s0)).toBe(dedent`
| ^
137| a: v=scoped_2
138| b: v=1
PASS: unscoped derived can change to dependent scoped and back
… scoped inherited atoms
ddb9ab7 to
f97006c
Compare
f97006c to
0fc1f98
Compare
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.
No description provided.