-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(boilerplate, cli): remove mobx-state-tree from the ignite boilerplate completely #2960
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
Conversation
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.
Pull Request Overview
Removes MobX-State-Tree from the Ignite boilerplate and replaces it with React Context providers for authentication and episode state management.
- Strips out all MST-related models, helpers, and Reactotron MST plugins
- Introduces
AuthContext
andEpisodeContext
providers and hooks - Updates screens and navigators to use the new context APIs
Reviewed Changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
boilerplate/app/screens/LoginScreen.tsx | Replaced MobX observer and useStores with useAuth |
boilerplate/app/screens/DemoPodcastListScreen.tsx | Switched from useStores to useEpisodes , refactored EpisodeCard |
boilerplate/app/screens/DemoDebugScreen.tsx | Replaced useStores with useAuth |
boilerplate/app/navigators/DemoNavigator.tsx | Wrapped Tab.Navigator with EpisodeProvider |
boilerplate/app/navigators/AppNavigator.tsx | Removed MST observer and useStores , now uses useAuth |
boilerplate/app/context/AuthContext.tsx | Added AuthProvider and useAuth hook |
boilerplate/app/context/EpisodeContext.tsx | Added EpisodeProvider and useEpisodes hook |
boilerplate/app/models | Removed all MobX-State-Tree model files |
boilerplate/app/app.tsx | Wrapped AppNavigator with AuthProvider , removed store rehydration |
README.md | Removed MobX references from documentation |
Comments suppressed due to low confidence (3)
boilerplate/app/context/EpisodeContext.tsx:11
- Add unit tests for
EpisodeContext
to verify behavior offetchEpisodes
,toggleFavorite
,hasFavorite
, andepisodesForList
under different scenarios.
import {
boilerplate/app/context/AuthContext.tsx:1
- Add unit tests for
AuthContext
to coversetAuthEmail
,setAuthToken
,logout
, and thevalidationError
logic.
import {
README.md:64
- [nitpick] Consider adding a section to the README with usage examples for the new
AuthContext
andEpisodeContext
providers to guide users migrating from MST.
| MobX-React-Lite | React Integration | v3 | Re-render React performantly |
e3ee03f
to
1eca65b
Compare
- `AuthContext`: This is a basic context that provides the demo app with a way to manage simple authentication state. We persist the data using MMKV hooks in this context provider. The app can consume the AuthContext wih the `useAuth` hook. | ||
- `EpisodeContext`: This context provides the demo app with a way to manage the list of episodes in the demo podcast screen. This context provides a `useEpisodes` hook that can be used to fetch the episodes and manage the state of the list. | ||
|
||
## State management solutions |
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.
Nice - I think this is a really great way to summarize the options.
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.
Hey @markrickert - I know this is still in draft and there's some CI to fix, but I had a special interest in this one, haha.
Took a look at the code changes and I think it all makes sense. I had a few suggestions, nothing that I would block on.
I pulled this branch, built Ignite locally, and spun up a new app with all the default settings. Ran it on Android and iOS and tapped around with no issues. I think we'll want to have other people test other setup configurations to make sure we didn't miss anything, but I think this is the right direction.
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.
This is tremendous work, @markrickert! I do have quite a few tweaks, but nothing that is particularly intense. Let me know if you want to discuss any of them.
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.
Good work!!
Nice to see how much this simplified the template code
export interface AuthProviderProps {} | ||
|
||
export const AuthProvider: FC<PropsWithChildren<AuthProviderProps>> = ({ children }) => { | ||
const [authToken, setAuthToken] = useMMKVString("AuthProvider.authToken") |
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.
I love this as a simple way to get persistence
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
f8461d4
to
1c9ff60
Compare
…d of all Co-authored-by: Jamon Holmgren <code@jamon.dev>
Co-authored-by: Jamon Holmgren <code@jamon.dev>
BREAKING CHANGE: adopt new architecture by default and remove legacy support (#2961 by @markrickert) - Enable New Architecture in all new projects; legacy option removed from CLI - Boilerplate and CLI now assume New Arch by default feat: upgrade to Expo SDK 53 with Android edge-to-edge support (#2938 by @fpena) - Upgrade to Expo SDK 53 and align all dependencies - Add support for Android edge-to-edge using SystemBars - Update app.json, jest-expo, metro.config, and related config for compatibility feat: remove mobx-state-tree and enable bring-your-own state management (#2960 by @markrickert) - Remove MST from boilerplate and CLI - Replace with lightweight React Context examples for demo state - Support persistence via useMMKVString feat: simplify theming with refactored ThemeProvider (#2970 by @markrickert) - Refactor useAppTheme and ThemeProvider for easier integration fix: address compatibility issues with React 19, TypeScript, and tests (#2966, #2968 by @objecttiveSee) - Solve TS 5.4/React 19 type issues and downgrade TS to 5.3.3 - Fix failing snapshots and metro test conditions - Add missing ESLint plugin and clean up demo code chore: update docs, config, and version alignment (#2964 by @frankcalise) - Sync README, quickstart, and context docs - Enforce node >= 20 and update linting rules across project
# [11.0.0](v10.5.3...v11.0.0) (2025-07-02) * Ignite v11 (Expo SDK 53) (#2938) ([154d2ed](154d2ed)), closes [#2938](#2938) [#2938](#2938) [#2960](#2960) [#2970](#2970) [#2966](#2966) [#2968](#2968) [#2964](#2964) ### Bug Fixes * **BackHandler:** switch to non-deprecated listener syntax [#2966](#2966) [skip ci] ([aeb3ee9](aeb3ee9)) * **types:** update useRef with default undefined value ([#2968](#2968)) [skip ci] ([1f7a8fe](1f7a8fe)) ### BREAKING CHANGES * adopt new architecture by default and remove legacy support (#2961 by @markrickert) - Enable New Architecture in all new projects; legacy option removed from CLI - Boilerplate and CLI now assume New Arch by default
Description
There's been internal discussion for a while about going state-agnostic with ignite because we hear so often that mobx is a barrier to adopting ignite. Even though there's a way to strip it out in the current cli, it just serves to add complexity without a whole lot of benefit anymore.
@jamonholmgren Even replied to a reddit thread about removing MST from ignite.
So here we are. It's gone. All traces of it 😬 I rewrote the current stores/models in pure react context and stripped everything relating to state management out.
This PR completely removes all state management options from
ignite-cli
:mobx
,mobx-state-tree
,mobx-react-lite
, & the reactotron pluginAuthStore
as a react context provider that uses mmvv hooks to persist the dataEpisodeStore
andEpisode
model as a typed react context providerChecklist
README.md
and other relevant documentation has been updated with my changesFuture