Skip to content
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

Untracked consumption errors in React renderer #25

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

wycats
Copy link
Member

@wycats wycats commented Jul 5, 2022

This commit adds infrastructure ("read barrier") that makes it possible
to emit errors if any cell is consumed in a rendering context, but it
is not inside a tracking frame.

It also threads through stack information for both the creation of
reactive variables and for consumption of reactive variables. Making
this a dev-time-only cost is extremely urgent and must be done before
0.6.

This commit also implements the read barrier assertion in the React
renderer. The long and short of it is that any reads that happen inside
of a React render function but outside of a useSetup or useReactive
will trigger the error.

Finally, this commit adds TIMELINE.entryPoint, which allows third-party
code to mask abstractions from developer tools and debug messages.

This allows libraries to help make sure that these messages actually
point at user code and not internals. The @starbeamx/store package
now makes use of this infrastructure.

This commit adds infrastructure ("read barrier") that makes it possible
to emit errors if any cell is consumed in a rendering context, but it
is not inside a tracking frame.

It also threads through stack information for both the creation of
reactive variables and for consumption of reactive variables. Making
this a dev-time-only cost is extremely urgent and must be done before
0.6.

This commit also implements the read barrier assertion in the React
renderer. The long and short of it is that any reads that happen inside
of a React render function but outside of a useSetup or useReactive
will trigger the error.

Finally, this commit adds TIMELINE.entryPoint, which allows third-party
code to mask abstractions from developer tools and debug messages.

This allows libraries to help make sure that these messages actually
point at user code and not internals. The `@starbeamx/store` package
now makes use of this infrastructure.
@wycats wycats marked this pull request as ready for review July 6, 2022 17:37
@wycats wycats merged commit 3fdd21a into main Jul 6, 2022
@wycats wycats deleted the read-barrier-assertions branch July 6, 2022 17:38
@wycats wycats mentioned this pull request Jul 27, 2022
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.

None yet

1 participant