-
Notifications
You must be signed in to change notification settings - Fork 140
Finish simplifying component definitions; component & screen generator tweaks #363
Conversation
…-wrapped and plain components Also, simplified the generated component content to require less initial work on new components, and moved the style definitions into the component file (since our predefined components all have integrated styles)
…omponents; tolerate either suffix Consistenly use kebab-case for filenames
@jamonholmgren NB: This replaces the |
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.
Looks good! We should have a discussion about major version vs minor in this case. I'm leaning toward major.
@bryanstearns @jamonholmgren I'll try to get the #362 tests sorted today. |
# [5.3.0](v5.2.1...v5.3.0) (2020-08-11) ### Features * **deps:** Bumps several dependencies ([#364](#364) by [@bryanstearns](https://github.com/bryanstearns)) ([4b1d8b5](4b1d8b5)) * **generators:** Finish simplifying component definitions; component & screen generator tweaks ([#363](#363)) [skip-ci] ([86b3223](86b3223)) * **react-native:** Bump React Native version to 0.63 ([#362](#362) by [@nirre7](https://github.com/nirre7)) ([4988e16](4988e16))
🎉 This PR is included in version 5.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Standardized component definitions
After internal deliberation at IR, we've concluded that it's best to use
function
syntax when declaring functional components (including screens; gets us more-useful stacktraces), and not to useReact.FunctionComponent
as the parent type of component prop interfaces (see #358). So, plain components are simply:Components wrapped with
mobx-react-lite
'sobserver
HOC (including nearly all screens) use this slightly-more-verbose version (which, yes, has the function name twice, but we feel this is a small price to pay for nice stacktraces!):So, then, this PR...
I started by cherry-picking the commits from #316 which generates screens in a subdirectory; they needed merge updates against current master (thanks to @lasharela for #316, and to @BrandonSM who contributed very similar work in #331). Then:
--observer
or--no-observer
on theignite generate component
command line.Screen
or-screen
equally; it now always uses kebab-case in the filenames.