dwk601: migrate from react to solidjs v2#158
Open
dwk601 wants to merge 9 commits intocommaai:masterfrom
Open
Conversation
…ests for CI compatibility
…nto react-to-solid-v2
…nto react-to-solid-v2
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.
This pull request migrates the project from React to SolidJS, introducing significant changes to dependencies, components, and state management. The migration improves performance and simplifies reactivity by leveraging SolidJS's fine-grained reactivity model. Below is a summary of the most important changes grouped by theme.
Dependency Updates:
react,react-dom,@types/react,@types/react-dom,@testing-library/react,@vitejs/plugin-react) with SolidJS equivalents (solid-js,@solidjs/testing-library,vite-plugin-solid). ([[1]](https://github.com/commaai/flash/pull/158/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L19-R31),[[2]](https://github.com/commaai/flash/pull/158/files#diff-58e6f63d87181b1c6a8cb6e5f1691df04aa32854456efcd52ca71c8541375d26L2-R6))Component Migration:
src/app/App.test.jsxto use SolidJS'sSuspenseand testing library, replacing React's JSX syntax with SolidJS's function-based syntax. ([src/app/App.test.jsxL1-R8](https://github.com/commaai/flash/pull/158/files#diff-18b239fda5f974720b36f7ddf26ad0c959231930566b5304afecde9cc066790cL1-R8))src/app/index.jsxandsrc/main.jsxto SolidJS, replacing React'sReactDOM.createRootwith SolidJS'srenderfunction and adding a development environment check for the root element. ([[1]](https://github.com/commaai/flash/pull/158/files#diff-5f8d22049fec5561962e53e43d834657f76af599fac66de962b2bfa10d251d4cL1-R1),[[2]](https://github.com/commaai/flash/pull/158/files#diff-752aae33033979082689dba3e7f51955013615f0535c21ac94265e067da311edL1-R18))State Management:
src/app/Flash.jsxfrom React'suseStateanduseRefto SolidJS'screateSignal,onMount, andonCleanup, ensuring state updates are reactive and scoped. ([[1]](https://github.com/commaai/flash/pull/158/files#diff-2f137e0d23b8115a30a10a4f9d67a736b048c2eb5b9029787834afa10888642bL1-R1),[[2]](https://github.com/commaai/flash/pull/158/files#diff-2f137e0d23b8115a30a10a4f9d67a736b048c2eb5b9029787834afa10888642bL175-R192),[[3]](https://github.com/commaai/flash/pull/158/files#diff-2f137e0d23b8115a30a10a4f9d67a736b048c2eb5b9029787834afa10888642bL202-R286))Flash.jsxto align with SolidJS's reactive primitives. ([src/app/Flash.jsxL202-R286](https://github.com/commaai/flash/pull/158/files#diff-2f137e0d23b8115a30a10a4f9d67a736b048c2eb5b9029787834afa10888642bL202-R286))Utility Updates:
src/utils/image.jsto replace React'suseEffectanduseRefwith SolidJS'sonMountand a plain object for managing theImageManagerreference. ([[1]](https://github.com/commaai/flash/pull/158/files#diff-c81787bf9bb6cd057667d950d2dc18cf721a556a19a51d19d0011ae1502c3553L1-R1),[[2]](https://github.com/commaai/flash/pull/158/files#diff-c81787bf9bb6cd057667d950d2dc18cf721a556a19a51d19d0011ae1502c3553L86-R93))Build Tool Configuration:
vite.config.js. ([vite.config.jsL2-R6](https://github.com/commaai/flash/pull/158/files#diff-58e6f63d87181b1c6a8cb6e5f1691df04aa32854456efcd52ca71c8541375d26L2-R6))