Skip to content

[compiler] Type provider infra for tests #30776

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

Closed
wants to merge 9 commits into from

Conversation

josephsavona
Copy link
Member

@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: f2c7e65
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: e5a2106
Pull Request resolved: #30776
josephsavona added a commit that referenced this pull request Aug 21, 2024
ghstack-source-id: d206061
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
Member 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: d7035a2
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: 1f2e147
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: dc14325
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: 5f1e140
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
Member 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: 012cb6f
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: bfdbf67
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