-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(gatsby): convert component-data-dependencies to typescript #24028
chore(gatsby): convert component-data-dependencies to typescript #24028
Conversation
This should be fine - it seems like legacy code that originally was added in #1503, but feature later on was removed as part of v2 release |
packages/gatsby/src/redux/reducers/__tests__/page-data-dependencies.ts
Outdated
Show resolved
Hide resolved
Thank you for the tough review @pieh! Added all suggestions, and some. I removed the |
…age-data-dependencies
if (state.connections.has(action.payload.connection)) { | ||
existingPaths = state.connections.get(action.payload.connection) | ||
existingPaths = state.connections.get(action.payload.connection)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so weird that TS is not smart enough to know that this for sure exists given the check above it, but 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you so much @Kornil - will just wait for CI tests to run again after one small small change (missed one string | number
-> string
change after your latest changes, so I went ahead and applied it)
Convert
src/redux/reducers/component-data-dependencies.ts
and test file to TypeScript.There is one change that can possibly affect production
In
src/redux/reducers/component-data-dependencies.ts
the actionCREATE_COMPONENT_DEPENDENCY
was referencing apayload.id
in line 19, 20, 31, 32. I found the key to not be used in the action itself, so I removed it. Let me know your opinion, I haven't seen it used.Related Issues
#21995