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

[compiler] Type provider infra for tests #30776

Closed
wants to merge 9 commits into from

Conversation

josephsavona
Copy link
Contributor

@josephsavona josephsavona commented Aug 21, 2024

Stack from ghstack (oldest at bottom):

Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 10:42pm

josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: f2c7e652c3bc17741e2dd0d360dfa0db19d664a3
Pull Request resolved: #30776
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Aug 21, 2024
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: e5a21067f93c34f7082622992675b371c078afe3
Pull Request resolved: #30776
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: d20606156784ed014170538d12388500f844320e
Pull Request resolved: #30776
@josephsavona josephsavona marked this pull request as ready for review August 21, 2024 21:08
Comment on lines -129 to -133
export const ModuleTypeResolver = z
.function()
.args(z.string())
.returns(z.nullable(TypeSchema));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting .returns() causes zod to return a function that internally validates the return type when you call it. that's cool but we want to control when the validation happens so i'm switching this to a plain function annotation

Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: d7035a2db59b4db3c935d07aa9c10f8c7124ea0a
Pull Request resolved: #30776
Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: 1f2e147caaab34e3ccdca10a4751c5901ae4a658
Pull Request resolved: #30776
Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: dc14325d877b3638979d21af2e876f4bf2aadebc
Pull Request resolved: #30776
Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: 5f1e140411006b39a55d8688f596e5a680aa96dc
Pull Request resolved: #30776
Comment on lines +51 to +65
useFreeze: {
kind: 'hook',
returnType: {kind: 'type', name: 'Any'},
},
useFragment: {
kind: 'hook',
returnType: {kind: 'type', name: 'MixedReadonly'},
noAlias: true,
},
useNoAlias: {
kind: 'hook',
returnType: {kind: 'type', name: 'Any'},
returnValueKind: ValueKindEnum.Mutable,
noAlias: true,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved from customHooks, which we can soon deprecate since it's already a no-op (we never look up information from it)

Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: 012cb6f5b9d11aff59c0c353a607241599a0d21a
Pull Request resolved: #30776
Adds snap/sprout support for type providers, with declarations describing some new functions in shared-runtime. This allows us to verify that the type provider infrastructure is working. I had to make a few fixes to workaround limitations in zod, but i think the types here are mostly stable enough that we won't have too much work keeping things in sync.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: bfdbf67e3dd0cbfd511bed0bd6ba92266cf99ab8
Pull Request resolved: #30776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants