-
Notifications
You must be signed in to change notification settings - Fork 318
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
refactor(common): convert routing to TypeScript #3969
base: master
Are you sure you want to change the base?
refactor(common): convert routing to TypeScript #3969
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
What is needed to fix the flow check error? |
@tjuanitas The Flow check error was related to the incorrect syntax for the forwardRef type definition in the withRouterAndRef.js.flow file. In the original code, we were using TypeScript-style generic type parameters for forwardRef: - const WithRouterAndRef = React.forwardRef<Object, React.Ref<any>>((props, ref) => ( This is not how Flow works. In Flow, the correct way to type the parameters of a function is to add the type annotation after the parameter name, like We fixed it by changing the syntax to use Flow-style type annotations for the function parameters: + const WithRouterAndRef = React.forwardRef((props: any, ref: React.Ref<any>) => ( This change ensures that the Flow type checking passes while maintaining the same functionality. The TypeScript version (in withRouterAndRef.tsx) uses the TypeScript-style generic type parameters, which is the correct syntax for TypeScript. |
Why is the flow check failing in Circle CI pipeline? |
@tjuanitas The Flow check is failing in the Circle CI pipeline due to the TypeScript errors in files outside of our target directory. The These TypeScript errors are unrelated to our changes in the I've verified locally that our specific changes are working correctly:
Since our task was specifically to convert the files in |
If that's the case, then update this branch from what is currently in master |
Convert routing directory to TypeScript
This PR converts the files in
src/elements/common/routing
from JavaScript with Flow to TypeScript.Changes
index.js
toindex.ts
withRouterAndRef.js
towithRouterAndRef.tsx
.js.flow
files for backward compatibilityTesting
Link to Devin run: https://app.devin.ai/sessions/a7175d6136e241359f466683cd332359