Closed agustif closed 1 year ago
Yeah I could do this easily, I'm the one who implemented it over at CUA. We have to see if it's compatible with our current next app.
Yeah I could do this easily, I'm the one who implemented it over at CUA. We have to see if it's compatible with our current next app.
Awesome, I was just actually checking your create-t3-app repo so it was funny that you commented so fast, thanks and appreciate it. hope it's an easy integration!
No hurries in my part, but it's certainly desirable to be able to run the same codebase in all the platforms!
Love all the t* stacks
I guess that middleware support is not available, let me try...
https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features
I guess that middleware support is not available, let me try...
https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features
Failing with:
../../node_modules/scheduler/cjs/scheduler.production.min.js
A Node.js API is used (MessageChannel at line: 121) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Import trace for requested module:
../../node_modules/scheduler/cjs/scheduler.production.min.js
../../node_modules/scheduler/index.js
../../node_modules/react-dom/cjs/react-dom.production.min.js
../../node_modules/react-dom/index.js
../../node_modules/next/dist/esm/client/script.js
../../node_modules/next/dist/esm/shared/lib/router/router.js
We'll have to see with @timothymiller how can we bundle a PWA to make up for this.
The reason why I did not initially include Tauri
support in T4
was because browser support for installing a PWA to the homescreen is universal across all the platforms right now. Even Safari supports it now.
I do see some value in supporting native desktop, but I see some hurdles blocking 100% code sharing with web.
useEffect
checks for auth status, instead of middleware. This is similar to how Expo does it currently.It's entirely possible React Native for desktop is a better solution in the medium to long term.
However, I do have some ideas on potential solutions in the meantime.
Create a separate project folder inside apps
for tauri native desktop. It could import the pages from Next.js, except for server side rendered routes. All the Tauri specific code could live in this new tauri folder.
Nextjs support static exports
See:
https://tauri.app/v1/guides/getting-started/setup/next-js/#nextjs-static-exports
And:
https://nextjs.org/docs/app/building-your-application/deploying/static-exports#supported-features
So I think you can use server components too?
Tauri is now being implemented over on the tauri branch as per #26 after I resolve the conflicts.
Tauri support is now in the tauri
branch
It's really nice since it adds back/forward buttons to the window title. Still need some work on the client side portions, however.
Hey, loving the project, I actually found it in the t3/cua createuniversalapp discord about t4, and that's where they recently landed tauri.
Wondering if it would be nice to bring tauri also inside the nextjs app into the t4 stack?