-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Turbopack support for Blitz #4314
Turbopack support for Blitz #4314
Conversation
Ensures the root context is read from the public API that webpack exposes. This is the first step for Turbopack support as Turbopack includes `this.rootContext` as well
🦋 Changeset detectedLatest commit: 263f23d The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Tobias Koppers <[email protected]>
Remaining for us to do
|
@timneutkens currently a blitzjs project build consume too much memory, can't even setup build on a 2gb machine (about 3.5g from my bizzare observation), will turbo improve this case ? |
No, turbopack, at the moment is for the dev server. Building will remain the same. |
But I guess it's very near, since turbo is almost 100% tests passed. |
This PR currently has a merge conflict. Please resolve this and then re-add the |
!preview |
!preview turbopack |
@@ -27,7 +27,7 @@ | |||
"@blitzjs/rpc": "latest", | |||
"@prisma/client": "4.6.1", | |||
"blitz": "latest", | |||
"next": "13.4.5", |
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 better stays on next 13. since next14 broken on vercel deploy.
!preview turbopack |
1 similar comment
!preview turbopack |
Snapshot Release turbopack |
Added @timneutkens contributions for doc, code and test |
This PR includes the changes required to make the Blitz loaders work with Turbopack. The biggest challenge is that Blitz currently uses private fields, namely
_compiler
(anything_
prefixed in webpack is private) and_compiler
is not available in Turbopack. Even if we were to mock the_compiler
being there Turbopack does not have the concept of multiple compilers running so thename
can't be relied upon to decide when to compile or not.Potentially a better solution for the webpack implementation is to use the
this.target
property (also not available in Turbopack) for the webpack implementation, that way you don't have to rely on internals that could change in the future.Even better would be passing an option for when to apply, e.g. using
isServer
in the custom webpack config that is applied to Next.js.Now for the Turbopack side of things:
browser
ornode
, PR: add conditions for webpack loader rules vercel/next.js#63333Here's the
next.config.js
edits I've made to run the Blitz rpc loaders:Notably Turbopack's glob matcher doesn't support
[
and]
yet and you can't reliably escape them, we'll work on fixing that, but for now I just used*
before and after the...blitz
path to wildcard match[[
and]]
.Please give it a try and let me know if it's working as intended, as far as I can tell it's applying the loaders correctly now but I'm not familiar enough with Blitz to know for certain that e.g. edge cases are working correctly too 🙏
Closes: ?
What are the changes and their implications?
Feature Checklist
pnpm changeset
in the root directory)