-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
improves baseUrl resolution in typescript monorepos #13542
improves baseUrl resolution in typescript monorepos #13542
Conversation
if vercel/next.js#13542 is merged, most of the yarn workspace + typescript config will be picked up automatically, removing the need for next-transpile-modules
Without this PR, if |
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! This will also support extends
. Can you add tests to test/integration
. I'd probably copy typescript-paths
into a new directory as this is slightly different and needs nesting of folders
cee85ce
to
ca4ff81
Compare
@timneutkens I have added the integration test under |
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 only adds support for it in tsconfig.json
, right? What about jsconfig.json
? 🙏
I have looked around a bit but I have failed to find a source or a even an example showing that I was also unable to identify the reference implementation to process Note that this change will support |
ca4ff81
to
8cc91ec
Compare
if vercel/next.js#13542 is merged, most of the yarn workspace + typescript config will be picked up automatically, removing the need for next-transpile-modules
|
8cc91ec
to
9280efe
Compare
I think I have addressed all the requested changes but I'm not used to github's review flow so I'm not sure if I should do something more. Please let me know if there is more I can do about this PR. |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 12.6s | 12.8s | |
nodeModulesSize | 65.3 MB | 65.3 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.23 | 2.271 | |
/ avg req/sec | 1121.32 | 1100.92 | -20.4 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.409 | 1.365 | -0.04 |
/error-in-render avg req/sec | 1774.09 | 1831.94 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..6c2a.js gzip | 10.5 kB | 10.5 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57 kB | 57 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.67 kB | 5.67 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.93 kB | 6.93 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.5 kB | 52.5 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.3 kB | 26.3 kB | ✓ |
Overall change | 26.3 kB | 26.3 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error.js gzip | 3.25 kB | 3.25 kB | ✓ |
hooks.js gzip | 881 B | 881 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.05 kB | 2.05 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 8.21 kB | 8.21 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.module.js gzip | 604 B | 604 B | ✓ |
_error.module.js gzip | 2.04 kB | 2.04 kB | ✓ |
hooks.module.js gzip | 383 B | 383 B | ✓ |
index.module.js gzip | 223 B | 223 B | ✓ |
link.module.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 281 B | 281 B | ✓ |
withRouter.m..dule.js gzip | 278 B | 278 B | ✓ |
Overall change | 5.32 kB | 5.32 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
index.html gzip | 926 B | 926 B | ✓ |
link.html gzip | 935 B | 935 B | ✓ |
withRouter.html gzip | 924 B | 924 B | ✓ |
Overall change | 2.79 kB | 2.79 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 13.7s | 13.4s | -241ms |
nodeModulesSize | 65.3 MB | 65.3 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..6c2a.js gzip | 10.5 kB | 10.5 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57 kB | 57 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.67 kB | 5.67 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.93 kB | 6.93 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.5 kB | 52.5 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.3 kB | 26.3 kB | ✓ |
Overall change | 26.3 kB | 26.3 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error.js gzip | 3.25 kB | 3.25 kB | ✓ |
hooks.js gzip | 881 B | 881 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.05 kB | 2.05 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 8.21 kB | 8.21 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.module.js gzip | 604 B | 604 B | ✓ |
_error.module.js gzip | 2.04 kB | 2.04 kB | ✓ |
hooks.module.js gzip | 383 B | 383 B | ✓ |
index.module.js gzip | 223 B | 223 B | ✓ |
link.module.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 281 B | 281 B | ✓ |
withRouter.m..dule.js gzip | 278 B | 278 B | ✓ |
Overall change | 5.32 kB | 5.32 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_error.js | 878 kB | 878 kB | ✓ |
404.html | 4.18 kB | 4.18 kB | ✓ |
hooks.html | 3.81 kB | 3.81 kB | ✓ |
index.js | 879 kB | 879 kB | ✓ |
link.js | 916 kB | 916 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 909 kB | 909 kB | ✓ |
Overall change | 4.5 MB | 4.5 MB | ✓ |
9280efe
to
7d6713d
Compare
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 14s | 14.1s | |
nodeModulesSize | 66 MB | 66 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.485 | 2.542 | |
/ avg req/sec | 1006.2 | 983.4 | -22.8 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.743 | 1.684 | -0.06 |
/error-in-render avg req/sec | 1434.26 | 1484.79 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..6c2a.js gzip | 10.5 kB | 10.5 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57 kB | 57 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.67 kB | 5.67 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.93 kB | 6.93 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.5 kB | 52.5 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.3 kB | 26.3 kB | ✓ |
Overall change | 26.3 kB | 26.3 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error.js gzip | 3.25 kB | 3.25 kB | ✓ |
hooks.js gzip | 881 B | 881 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.05 kB | 2.05 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 8.21 kB | 8.21 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.module.js gzip | 604 B | 604 B | ✓ |
_error.module.js gzip | 2.04 kB | 2.04 kB | ✓ |
hooks.module.js gzip | 383 B | 383 B | ✓ |
index.module.js gzip | 223 B | 223 B | ✓ |
link.module.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 281 B | 281 B | ✓ |
withRouter.m..dule.js gzip | 278 B | 278 B | ✓ |
Overall change | 5.32 kB | 5.32 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
index.html gzip | 924 B | 924 B | ✓ |
link.html gzip | 934 B | 934 B | ✓ |
withRouter.html gzip | 922 B | 922 B | ✓ |
Overall change | 2.78 kB | 2.78 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 15.3s | 15.4s | |
nodeModulesSize | 66 MB | 66 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..6c2a.js gzip | 10.5 kB | 10.5 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57 kB | 57 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.67 kB | 5.67 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.93 kB | 6.93 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.5 kB | 52.5 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.3 kB | 26.3 kB | ✓ |
Overall change | 26.3 kB | 26.3 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error.js gzip | 3.25 kB | 3.25 kB | ✓ |
hooks.js gzip | 881 B | 881 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.05 kB | 2.05 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 8.21 kB | 8.21 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app.module.js gzip | 604 B | 604 B | ✓ |
_error.module.js gzip | 2.04 kB | 2.04 kB | ✓ |
hooks.module.js gzip | 383 B | 383 B | ✓ |
index.module.js gzip | 223 B | 223 B | ✓ |
link.module.js gzip | 1.51 kB | 1.51 kB | ✓ |
routerDirect..dule.js gzip | 281 B | 281 B | ✓ |
withRouter.m..dule.js gzip | 278 B | 278 B | ✓ |
Overall change | 5.32 kB | 5.32 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_error.js | 878 kB | 878 kB | ✓ |
404.html | 4.18 kB | 4.18 kB | ✓ |
hooks.html | 3.81 kB | 3.81 kB | ✓ |
index.js | 879 kB | 879 kB | ✓ |
link.js | 916 kB | 916 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 909 kB | 909 kB | ✓ |
Overall change | 4.5 MB | 4.5 MB | ✓ |
hello @Timer, @timneutkens, I think I have addressed the requested changes, I have rebased against the latest canary. Feel free to ping me if there are any more concerns about this. thanks |
7d6713d
to
d5500e5
Compare
04e364a
to
194c75b
Compare
fwiw, I'd be already happy to just have |
194c75b
to
6e199f9
Compare
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 12.9s | 12.7s | -188ms |
nodeModulesSize | 66.5 MB | 66.5 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.051 | 2.04 | -0.01 |
/ avg req/sec | 1218.71 | 1225.67 | +6.96 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.256 | 1.269 | |
/error-in-render avg req/sec | 1990.54 | 1970.61 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
index.html gzip | 948 B | 948 B | ✓ |
link.html gzip | 955 B | 955 B | ✓ |
withRouter.html gzip | 941 B | 941 B | ✓ |
Overall change | 2.84 kB | 2.84 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 14.5s | 13.6s | -914ms |
nodeModulesSize | 66.5 MB | 66.5 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Serverless bundles
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_error.js | 881 kB | 881 kB | ✓ |
404.html | 4.18 kB | 4.18 kB | ✓ |
hooks.html | 3.82 kB | 3.82 kB | ✓ |
index.js | 882 kB | 882 kB | ✓ |
link.js | 923 kB | 923 kB | ✓ |
routerDirect.js | 917 kB | 917 kB | ✓ |
withRouter.js | 917 kB | 917 kB | ✓ |
Overall change | 4.53 MB | 4.53 MB | ✓ |
6e199f9
to
2258885
Compare
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
2258885
to
37d3a4a
Compare
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 13s | 12.7s | -264ms |
nodeModulesSize | 66.5 MB | 66.5 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.034 | 2.025 | -0.01 |
/ avg req/sec | 1228.9 | 1234.33 | +5.43 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.324 | 1.262 | -0.06 |
/error-in-render avg req/sec | 1887.81 | 1981.49 | +93.68 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
index.html gzip | 948 B | 948 B | ✓ |
link.html gzip | 955 B | 955 B | ✓ |
withRouter.html gzip | 941 B | 941 B | ✓ |
Overall change | 2.84 kB | 2.84 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 13.9s | 14.2s | |
nodeModulesSize | 66.5 MB | 66.5 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Serverless bundles
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_error.js | 881 kB | 881 kB | ✓ |
404.html | 4.18 kB | 4.18 kB | ✓ |
hooks.html | 3.82 kB | 3.82 kB | ✓ |
index.js | 882 kB | 882 kB | ✓ |
link.js | 923 kB | 923 kB | ✓ |
routerDirect.js | 917 kB | 917 kB | ✓ |
withRouter.js | 917 kB | 917 kB | ✓ |
Overall change | 4.53 MB | 4.53 MB | ✓ |
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 10.6s | 10.6s | |
nodeModulesSize | 66.5 MB | 66.5 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.749 | 1.781 | |
/ avg req/sec | 1429.53 | 1404.08 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.042 | 1.034 | -0.01 |
/error-in-render avg req/sec | 2399.06 | 2418.47 | +19.41 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
index.html gzip | 948 B | 948 B | ✓ |
link.html gzip | 955 B | 955 B | ✓ |
withRouter.html gzip | 941 B | 941 B | ✓ |
Overall change | 2.84 kB | 2.84 kB | ✓ |
Serverless Mode
General Overall increase ⚠️
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
buildDuration | 11.7s | 12.9s | |
nodeModulesSize | 66.5 MB | 66.5 MB |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..db49.js gzip | 9.7 kB | 9.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-35b59ab..f28f.js gzip | 6.72 kB | 6.72 kB | ✓ |
polyfills-05..1236.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-488d..c0e7.js gzip | 751 B | 751 B | ✓ |
Overall change | 87.1 kB | 87.1 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.1 kB | 6.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
main-0e6fc45..dule.js gzip | 5.79 kB | 5.79 kB | ✓ |
polyfills-05..dule.js gzip | 30.8 kB | 30.8 kB | ✓ |
webpack-4f62..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 82.6 kB | 82.6 kB | ✓ |
Client Pages
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-8f5f611..1f7b.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8e69b..8695.js gzip | 3.41 kB | 3.41 kB | ✓ |
hooks-f7f3d0..7465.js gzip | 887 B | 887 B | ✓ |
index-08fb3f..c0e9.js gzip | 227 B | 227 B | ✓ |
link-ddd176e..5566.js gzip | 1.29 kB | 1.29 kB | ✓ |
routerDirect..8aa1.js gzip | 284 B | 284 B | ✓ |
withRouter-f..e777.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.66 kB | 7.66 kB | ✓ |
Client Pages Modern
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_app-669dbe5..dule.js gzip | 626 B | 626 B | ✓ |
_error-663e6..dule.js gzip | 2.24 kB | 2.24 kB | ✓ |
hooks-805c40..dule.js gzip | 387 B | 387 B | ✓ |
index-6ba5a4..dule.js gzip | 226 B | 226 B | ✓ |
link-69bc264..dule.js gzip | 1.25 kB | 1.25 kB | ✓ |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-d..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.29 kB | 5.29 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_buildManifest.js gzip | 275 B | 275 B | ✓ |
_buildManife..dule.js gzip | 281 B | 281 B | ✓ |
Overall change | 556 B | 556 B | ✓ |
Serverless bundles
vercel/next.js canary | jeantil/next.js fix-monorepo-ts-baseUrl-resolution | Change | |
---|---|---|---|
_error.js | 881 kB | 881 kB | ✓ |
404.html | 4.18 kB | 4.18 kB | ✓ |
hooks.html | 3.82 kB | 3.82 kB | ✓ |
index.js | 882 kB | 882 kB | ✓ |
link.js | 923 kB | 923 kB | ✓ |
routerDirect.js | 917 kB | 917 kB | ✓ |
withRouter.js | 917 kB | 917 kB | ✓ |
Overall change | 4.53 MB | 4.53 MB | ✓ |
This was just fixed in 9.5.1, please upgrade! |
Is there a place with a simple example implementation of this? |
Made a quick example workspace project, To see the changes needed from next-transpile-modules, have a look to belgattitude/next-transpile-ts-workspace#5 Huge thanks @jeantil |
@hdngr have you looked at the integration test added by the PR ? https://github.com/vercel/next.js/tree/canary/test/integration/typescript-workspaces-paths Both correctly resolve typescript source files through tsconfig including using paths and extending typescript configs. They still require some kind of configuration to transpile the typescript files, that won't be necessary anymore if #15569 is merged. |
@jeantil I noticed that extending works only for |
I noticed that too, it's completely unrelated to the changes in this PR,
since it the setting added is exactly the same as the one in my base tsconfig, I didn't spend any time to see why it failed to detect the extended setting... |
@jeantil is there a way to get Next to recompile on change of above-cwd files within |
Hi @jeantil, I've tried the approach and have some questions:
Thanks. |
hi @juuyan Sorry I can't really help, I investigated and proposed patch to solve the issues I was encountering at the time (9 months ago). I think it is safe to say that the goal of #15569 has not been achieved by other means unless the integration test hasn't been updated after the root issue was fixed. easiest way to test is to clone next.js, run the current integration test then remove the paths mapping section and re run the test :) |
@jeantil |
Typescript configuration can inherit from files above cwd in the
filesystem. If a baseUrl was declared in such a file, it would not be
picked up by the webpack config. This would force users to use the
next-transpile-module and duplicate configuration with unintuitive path
relations (see #13197 for a detailed analysis)
If baseUrl is resolved it should be used instead of dir as the root
include for babel-resolve-loader.
An even nicer DX would auto detect the presence of a
paths
section inthe typescript config and automatically include
tsconfig-paths-webpack-plugin
fixes #13197
fixes #13616
fixes partially #9474