chore(js-ts): Convert index.js to TypeScript#307
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
chore(js-ts): Convert index.js to TypeScript#307devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
Author
🤖 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:
|
…js wrapper - Moved TypeScript entry point logic from index.ts to app/entry.ts - Created thin index.js wrapper for Metro bundler compatibility - Updated import paths in app/entry.ts for new location - Removed index.ts from tsconfig.json include (app/entry.ts covered by app/**/*) Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the root-level
index.jsapplication entry point to TypeScript as part of the ongoing JavaScript to TypeScript migration effort.Architecture
Due to Metro bundler and CI scripts expecting
index.jsas the entry file, this PR uses a wrapper pattern:index.js- Thin wrapper that imports from the TypeScript entry point (required for Metro bundler compatibility)app/entry.ts- Contains all the actual application initialization logic in TypeScriptChanges:
app/entry.tswith all entry point logic converted to TypeScriptindex.jsto a single import statementglobal.ErrorUtils(React Native's global error handler)ErrorUtilsimport from react-native (now using typedglobal.ErrorUtils)handleCustomErrorto matchErrorHandlerCallbacktypeapp/entry.tsfor the new locationReview & Testing Checklist for Human
handleCustomError as ErrorHandlerCallbacktype cast (app/entry.ts line 113) - This is a workaround for a pre-existing type mismatch wherehandleCustomErrorexpects(Error, boolean)butErrorHandlerCallbackexpects(any, boolean?). The cast is safe but worth noting.app/entry.tsare correct (e.g.,../shim.js,./util/sentry/utils,../app.config.js)yarn watchand test basic functionality to ensure error handling still worksRecommended Test Plan
yarn watchand verify the app launches without errorsNotes
build,js-bundle-size-check, and all 10unit-testsshards pass ✅lintandlint:tscCI jobs were cancelled but verified locally before pushingaudit:ci,check-pr-labels,CLABot,sonar-cloud-quality-gate-status) are unrelated to this migration