-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Port next-ssg getStaticProps/getServerSideProps tree shaking Babel transform to rust #27552
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,4 @@ | |||
[build] |
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 temporary. I'll remove this after implementing support for stable rust in testing system of swc.
@@ -0,0 +1 @@ | |||
nightly-2021-03-25 |
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.
Same as above. It's temporary, and I think using stable is better.
@@ -172,7 +173,7 @@ fn process_js_custom( | |||
} | |||
}; | |||
let config = BuiltConfig { |
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 think we need some way to organize passes properly.
This comment has been minimized.
This comment has been minimized.
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.
Looks great 🎉
|
I think the CI issues actually are related. I was experiencing the same thing when I was trying to open up a PR with the new testing setup on Friday. For some reason the errors are being hidden when running yarn from the root, but you can see this task is failing to build the js files in the fixtures when running yarn in |
Thanks! I excluded them. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 7c152b7 test/acceptance/ReactRefreshLogBox.dev.test.js
Expand output● server-side only compilation errors
|
Stats from current PRDefault Build (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
buildDuration | 13.2s | 12.6s | -635ms |
buildDurationCached | 3.1s | 3s | -131ms |
nodeModulesSize | 50.1 MB | 50.1 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.291 | 2.279 | -0.01 |
/ avg req/sec | 1091.28 | 1097.19 | +5.91 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.256 | 1.28 | |
/error-in-render avg req/sec | 1990.67 | 1952.99 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
745.HASH.js gzip | 179 B | 179 B | ✓ |
framework-HASH.js gzip | 42.2 kB | 42.2 kB | ✓ |
main-HASH.js gzip | 22.8 kB | 22.8 kB | ✓ |
webpack-HASH.js gzip | 1.5 kB | 1.5 kB | ✓ |
Overall change | 66.7 kB | 66.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
_app-HASH.js gzip | 980 B | 980 B | ✓ |
_error-HASH.js gzip | 194 B | 194 B | ✓ |
amp-HASH.js gzip | 312 B | 312 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
dynamic-HASH.js gzip | 2.52 kB | 2.52 kB | ✓ |
head-HASH.js gzip | 350 B | 350 B | ✓ |
hooks-HASH.js gzip | 904 B | 904 B | ✓ |
image-HASH.js gzip | 4.13 kB | 4.13 kB | ✓ |
index-HASH.js gzip | 261 B | 261 B | ✓ |
link-HASH.js gzip | 1.66 kB | 1.66 kB | ✓ |
routerDirect..HASH.js gzip | 319 B | 319 B | ✓ |
script-HASH.js gzip | 387 B | 387 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 12.8 kB | 12.8 kB | ✓ |
Client Build Manifests
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
_buildManifest.js gzip | 492 B | 492 B | ✓ |
Overall change | 492 B | 492 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
index.html gzip | 531 B | 531 B | ✓ |
link.html gzip | 543 B | 543 B | ✓ |
withRouter.html gzip | 524 B | 524 B | ✓ |
Overall change | 1.6 kB | 1.6 kB | ✓ |
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
buildDuration | 10.2s | 10.2s | |
buildDurationCached | 4.2s | 4s | -158ms |
nodeModulesSize | 50.1 MB | 50.1 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.279 | 2.339 | |
/ avg req/sec | 1096.79 | 1069.02 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.277 | 1.213 | -0.06 |
/error-in-render avg req/sec | 1957.46 | 2060.49 | +103.03 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
17.HASH.js gzip | 185 B | 185 B | ✓ |
677f882d2ed8..HASH.js gzip | 13.8 kB | 13.8 kB | ✓ |
framework.HASH.js gzip | 41.9 kB | 41.9 kB | ✓ |
main-HASH.js gzip | 10.6 kB | 10.6 kB | ✓ |
webpack-HASH.js gzip | 1.19 kB | 1.19 kB | ✓ |
Overall change | 67.7 kB | 67.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
_app-HASH.js gzip | 965 B | 965 B | ✓ |
_error-HASH.js gzip | 3.74 kB | 3.74 kB | ✓ |
amp-HASH.js gzip | 552 B | 552 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
dynamic-HASH.js gzip | 2.71 kB | 2.71 kB | ✓ |
head-HASH.js gzip | 2.97 kB | 2.97 kB | ✓ |
hooks-HASH.js gzip | 911 B | 911 B | ✓ |
index-HASH.js gzip | 231 B | 231 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 298 B | 298 B | ✓ |
script-HASH.js gzip | 2.94 kB | 2.94 kB | ✓ |
withRouter-HASH.js gzip | 294 B | 294 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 17.7 kB | 17.7 kB | ✓ |
Client Build Manifests
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
_buildManifest.js gzip | 499 B | 499 B | ✓ |
Overall change | 499 B | 499 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | kdy1/next.js swc-next-ssg | Change | |
---|---|---|---|
index.html gzip | 577 B | 577 B | ✓ |
link.html gzip | 589 B | 589 B | ✓ |
withRouter.html gzip | 569 B | 569 B | ✓ |
Overall change | 1.74 kB | 1.74 kB | ✓ |
Hi guys, I am digging this PR because I'm very interested in the ability to have server-side and client-side code mixed in an isomorphic manner, I'd like to use a similar approach to define data models, form inputs, and some API endpoints in one single file. |
Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples
Currently, the PR is not ready.
Remaining tasks:
should support export { _ as default }
(test)should support babel-style memoized function
(test)destructuring assignment (object)
(test)destructuring assignment (array)
(test)export var __N_SSG = true
to correct position.I added a rust-side test because debugging rust code with jest is literally impossible.
I need some comments about unit testing. How should it be organized?
I used the existing test suite, but I also added a rust-based testing system.