Skip to content

Conversation

@dmaskasky
Copy link
Member

No description provided.

@dmaskasky dmaskasky force-pushed the 11-17_transactional-readatomstate branch 6 times, most recently from 9bd633e to 7cd1176 Compare November 20, 2025 00:23
@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 20, 2025

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.

@dmaskasky dmaskasky force-pushed the 11-17_transactional-readatomstate branch 5 times, most recently from 6bfab5f to 21df872 Compare November 20, 2025 05:40
@dmaskasky dmaskasky force-pushed the 11-17_transactional-readatomstate branch 2 times, most recently from 350f2a7 to aace9e1 Compare December 8, 2025 21:40
@dmaskasky dmaskasky marked this pull request as ready for review December 9, 2025 05:39
- 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
@dmaskasky dmaskasky force-pushed the 11-17_transactional-readatomstate branch from ddb9ab7 to f97006c Compare December 9, 2025 05:53
@dmaskasky dmaskasky force-pushed the 11-17_transactional-readatomstate branch from f97006c to 0fc1f98 Compare December 9, 2025 06:04
@dmaskasky dmaskasky changed the title 11 17 transactional readatomstate virtual bi-stable proxy for dependent scoped atoms Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants