Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Question re Fiber support #5

Open
AlexJeffcott opened this issue Jun 23, 2022 · 2 comments
Open

Question re Fiber support #5

AlexJeffcott opened this issue Jun 23, 2022 · 2 comments
Assignees

Comments

@AlexJeffcott
Copy link

AlexJeffcott commented Jun 23, 2022

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.

@aidenybai
Copy link
Owner

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!

@aidenybai aidenybai self-assigned this Jun 23, 2022
@AlexJeffcott
Copy link
Author

wow - sound likes a lot of work and a huge scope!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants