write documentation requiring React components to have .jsx extension instead of .js
Opened this issue · 1 comments
aqandrew commented
Dependency
- Merge: #1778
Overview
As a consequence of our Vite migration, we need to document the necessity for components to have .jsx file extensions
More Info
Traditionally, React components may be written in either .js or .jsx files. Our new build tool, Vite, requires that all files containing React components have the .jsx extension. This practice helps to prevent errors during Vite's static analysis of imported files.
Action Items
- create new wiki page: "Vite Migration: Why Vite Components Require JSX Extensions"
- make a note clearly stating that all new components must have
.jsx
extensions- (optional) copy the contents of the
More Info
section into the wiki page
- (optional) copy the contents of the
- summarize the relevant information provided by the links in Resources
- copy the "Migrated Files" into a section in the wiki
- add the links in this ticket's Resources into the wiki's Resources
- make a note clearly stating that all new components must have
- comment the link to the newly published wiki page as a comment on this ticket
Resources/Instructions
Links for page's content
- vitejs/vite#13715 (comment) quoting Evan You, creator of Vite
- https://stackoverflow.com/a/76726872/6432160
Migrated Files
### Migrated Component Files
- components/Map/index.jsx
- components/common/ChipList/index.jsx
- components/main/Desktop/CouncilSelector/index.jsx
- components/main/Desktop/FilterMenu.jsx
- components/main/Desktop/TypeSelector/index.jsx
- components/main/Desktop/index.jsx
ryanfchase commented
Editing ticket's action items: let's have this documentation in a wiki page, and we can link this wiki page in the README