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

fix(core): align createNodesFromFiles options type with createNodes callback #30332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RobbyRabbitman
Copy link

@RobbyRabbitman RobbyRabbitman commented Mar 11, 2025

Current Behavior

type of option from createNodes() callback does not match type of option of createNodesFromFiles. Change was introduced in 20.5.0 by #29935.

A workaround in 20.5.0 is to get a type by using Parameters<typeof createNodesFromFiles<MyOptions>>[0]. Before 20.5.0 you could use CreateNodesFunction<MyOptions> when you wanted to type your createNodes function. Of course you could pass an arrow function, but I think many plugin authors use a separate function.

Expected Behavior

They should have the same types or there should be a public type of the createNodes() callback, so that users have better dx.

Related Issue(s)

Fixes #

@RobbyRabbitman RobbyRabbitman requested a review from a team as a code owner March 11, 2025 11:30
Copy link

vercel bot commented Mar 11, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2025 11:33am

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.

1 participant