Commit graph

3084 commits

Author SHA1 Message Date
Joe Haddad
775bdc341e
fix: correctly handle fallbacks for webpack 5 (#22497)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-02-24 10:25:57 -06:00
JJ Kasper
9d2b0fc04a
Ensure rewrites are resolved while prefetching (#22442)
This ensures we handle resolve rewrites during prefetching the same way we do during a client-transition. Previously if a rewritten source was used in an `href` neither the page bundle or SSG data if needed would be prefetched although would work correctly on a client transition. 


Fixes: https://github.com/vercel/next.js/issues/22441
2021-02-24 15:37:13 +00:00
JJ Kasper
59d467542a v10.0.8-canary.7 2021-02-23 17:12:34 -06:00
JJ Kasper
5cf16ece71
Ensure static 500 hydrates correctly with query (#22468)
Follow-up to https://github.com/vercel/next.js/pull/22139 this ensures the default 500 error page hydrates with the correct `statusCode` prop when updating query values on the client since currently it will switch the 404 `statusCode` when one isn't present. An additional test case has been added to ensure this is handled correctly.
2021-02-23 22:15:46 +00:00
Joe Haddad
f8cd075870
chore: upgrade webpack5 (#22460)
Upgrades webpack 5 and watchpack to their latest versions.
2021-02-23 16:57:23 +00:00
JJ Kasper
435eef75e2 v10.0.8-canary.6 2021-02-22 10:57:07 -06:00
JJ Kasper
51e0752f87
Add generating static 500 status page (#22139)
This adds generating a static 500 status page when a `pages/500.js` file is added similar to how we handle generating static 404 pages when `pages/404.js` is present. This allows showing a customized error page when a 500 error occurs in an optimal way.
2021-02-22 16:29:50 +00:00
Tim Neutkens
9ab98bc956
Reduce webpack watcher aggregate timing (#22418)
Reduces the time the watcher waits for events coming in before compiling.
2021-02-22 14:06:49 +00:00
Tim Neutkens
76e2bb57ad v10.0.8-canary.5 2021-02-19 11:11:15 +01:00
Tim Neutkens
3cef2e10ed
Delay server compilation until client compilation is done in development (#22187)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-02-19 11:10:19 +01:00
Joe Haddad
ef666f2e9a
v10.0.8-canary.4 2021-02-18 23:54:40 -05:00
JJ Kasper
9793e9004f
Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode. 

Closes: https://github.com/vercel/next.js/issues/14903
2021-02-18 18:34:33 +00:00
JJ Kasper
12cd2f9f11 v10.0.8-canary.3 2021-02-18 10:38:42 -06:00
Joe Haddad
4335237aad
v10.0.8-canary.2 2021-02-18 10:03:36 -05:00
Joe Haddad
99a4ea6e9a
feat(next/image): remove sharp for wasm variant (#22253)
This pull request removes the native `sharp` dependency (which doesn't work on some Linux variants, nor **M1 Mac**) and replaces it with a wasm equivalent.

It also reduces Next.js' installed size by 27.3 MB.

The code is adapted from the [Squoosh CLI](https://github.com/GoogleChromeLabs/squoosh).

This PR still supports:

- Rotation normalization
- Resizing
- PNG
- JPEG
- Webp

However, it (temporarily) removes support for:
- Resizing Gifs
- Resizing Tiff

(these formats still get served and rendered correctly by the image component)

---

Fixes #20456
Closes #20738
Closes #21762
2021-02-18 10:23:24 +00:00
JJ Kasper
62803a9d40 v10.0.8-canary.1 2021-02-17 17:08:28 -06:00
Janicklas Ralph
cf6bc446ea
Experimental feature - fix optimizeCss flag for serverless deployments (#21790) 2021-02-17 22:52:43 +00:00
Tim Neutkens
c64005ffd5 v10.0.8-canary.0 2021-02-16 09:57:24 +01:00
Kristoffer K
89edd34ff8
fix: register webpack hook earlier and use absolute paths (#21877) 2021-02-16 09:51:52 +01:00
Joe Haddad
80c9522750
v10.0.7 2021-02-15 15:39:02 -05:00
Tim Neutkens
57ed93bc5e v10.0.7-canary.8 2021-02-12 14:25:43 +01:00
matamatanot
b3aa1d14ff
Upgrade to lerna 4 (#22039)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-02-12 13:34:25 +01:00
Tim Neutkens
83657b6bce
Check if parentspan is provided in profiler (#22061)
Co-authored-by: Dale Bustad <dale@divmain.com>
2021-02-12 11:17:38 +01:00
Joe Haddad
5f41abda9a
fix(link): cancel idle callback on unmount (#22072)
Co-authored-by: mAAdhaTTah <jamesorodig@gmail.com>
2021-02-11 13:51:41 -05:00
JJ Kasper
27b6dd6b02 v10.0.7-canary.7 2021-02-11 09:41:58 -06:00
JJ Kasper
55e4a3d1ad
Only create locale domain links if on locale domain (#22032)
This updates to only create locale domain links if the current hostname is a locale domain to prevent making links unvisitable in development and preview environments where the configured locale domains don't point to the current build. 

Closes: https://github.com/vercel/next.js/issues/21211
Closes: https://github.com/vercel/next.js/issues/22011
2021-02-11 10:18:24 +00:00
JJ Kasper
5febe218a6
Add nccing AMP optimizer (#21980)
This adds ncc'ing the AMP optimizer package to speed up install times and cache the runtime. 

Closes: https://github.com/vercel/next.js/issues/20404
2021-02-11 09:55:56 +00:00
JJ Kasper
3f94f33ba2
Ensure error is passed up in minimal mode (#22030)
This ensures we pass the error up to the top-level when in minimal mode
2021-02-11 09:31:49 +00:00
Tim Neutkens
6b99bda3e3
Fix profiling plugin for next build (#21989)
Makes sure `yarn trace build` works.
2021-02-09 23:21:38 +00:00
Tim Neutkens
6369981754 v10.0.7-canary.6 2021-02-07 20:07:22 +01:00
Tim Neutkens
44fa86e384
Make sure all modules are included in the stats file (#21942) 2021-02-07 20:06:41 +01:00
Tim Neutkens
8b44bccd88 v10.0.7-canary.5 2021-02-05 17:41:49 +01:00
Tim Neutkens
6387f368dc
Update reasons array to use module id instead of identifier (#21895)
Missed this then changing the modules array to rely on `module.id`
2021-02-05 16:39:46 +00:00
Joe Haddad
b678d68705
v10.0.7-canary.4 2021-02-04 14:23:23 -05:00
Tim Neutkens
15d02f6559
Make experimental stats file approximately 90% smaller (#21858)
Tested against some smaller apps. Will have a high impact for larger apps.
2021-02-04 19:21:54 +00:00
Guy Bedford
234e1c9601
feat: Implement webpack require hook (#21802)
This implements the compatibility require hook as per https://github.com/vercel/next.js/issues/21789.

The hook is applied at the point of webpack initialization. In addition the separate packages are exposed for the various webpack subrequires.

The test then ensures instance equality for the basic require hook from the next.js config file.

I suspect this might have bad interactions with Yarn Pnp support, but maybe we will be lucky.
2021-02-04 08:49:42 +00:00
Joe Haddad
5fff814ca1
v10.0.7-canary.3 2021-02-03 15:46:57 -05:00
JJ Kasper
6d80e6e5f3
Add version for stats (#21823)
Adds versioning for the stats output
2021-02-03 20:46:35 +00:00
Tim Neutkens
379ad1b302
Rename package build scripts to dev (#21743)
The top-level script has always been `dev` so this makes the package scripts consistent
2021-02-03 17:02:44 +00:00
Guy Bedford
a6c1f9cfe7
Add webpack type to ncc bundle (#21785)
This adds a simple typing definition to the Webpack ncc output.

Fixes https://github.com/vercel/next.js/issues/21390.
2021-02-03 16:39:59 +00:00
JJ Kasper
41b7c524fa v10.0.7-canary.2 2021-02-02 15:52:34 -06:00
JJ Kasper
a65f8c3e0e
Update stats flag default (#21791) 2021-02-02 21:38:50 +00:00
Tim Neutkens
2079b74431 v10.0.7-canary.1 2021-02-02 17:15:24 +01:00
JJ Kasper
523537178c
Add stats config option (#21761)
This adds a config to output webpack's stats
2021-02-02 15:39:39 +00:00
Tim Neutkens
36aeca8f04 v10.0.7-canary.0 2021-02-01 12:56:04 +01:00
Guy Bedford
d5a4dec042
fix: add declarations for compiled webpack and loader (#21741)
This should resolve the typing issues described in https://github.com/vercel/next.js/issues/21390 from the webpack inlining, by declaring `next/dist/compiled/webpack` in the main typing file as a source.
2021-02-01 11:27:41 +00:00
Rafael Bonalume Lebre
60e699555d
Fix #top anchor link scroll (#16638)
According to [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href) the page must scroll to the top with both "#" and "#top" anchors.

<img width="675" alt="Screen Shot 2020-08-27 at 7 20 19 PM" src="https://user-images.githubusercontent.com/13899924/91500693-582a5b80-e89a-11ea-803f-4592d458baba.png">
2021-01-30 04:32:00 +00:00
Joe Haddad
5201cdbaea
v10.0.6 2021-01-29 15:21:46 -05:00
Joe Haddad
f8f2a173e3
v10.0.6-canary.12 2021-01-29 14:45:49 -05:00
Joe Haddad
558289247e
v10.0.6-canary.11 2021-01-29 11:36:36 -05:00