million-react
million-react copied to clipboard
Question re Fiber support
Good morning and thanks for this exciting project!
Like many developers who want to use the best possible practices and stack for new React SPA projects. For me, this means Vite and friends and very possibly million.
HOWEVER, it also seems natural that I would want to use Suspense in my routes. I could imagine that it could look something like this:
import { StrictMode, Suspense, lazy } from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { ErrorBoundary, LazyLoadingFallbackUI } from './components';
const LandingPage = lazy(() => import('./pages/landingPage'));
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<StrictMode>
<ErrorBoundary>
<BrowserRouter>
<Suspense fallback={<LazyLoadingFallbackUI />}>
<Routes>
<Route path="/" element={<LandingPage />} />
</Routes>
</Suspense>
</BrowserRouter>
</ErrorBoundary>
</StrictMode>
);
It would put me off, reasobably or otherwise, and would likely act as a blocker to adoption at companies, reasonably or otherwise.
Can I know more about your thoughts on this? What is the thinking behind this choice? Is it perhaps on some roadmap? It is undesirable or simply irrelevant in some way?
While I think it could be the case that I am labouring under misunderstandings about the scope or even the purpose/functionality of million, I suspect that I would not be alone in this and would love to better understand.
Hey @AlexJeffcott, thanks for your interest in Million!
Suspense/Fiber (as well as the limitations described) are on the roadmap. I'm currently working on pressure testing Million against libraries by trying to get wouter
to work and haven't been able to work on Suspense!
Million's React compat is still very early stage (the initial alpha alpha release was 2-3 weeks ago!) so a lot of features / libraries may not be supported yet.
Hopefully Suspense can be implemented by Aug/Sept!
wow - sound likes a lot of work and a huge scope!