Commit graph

6379 commits

Author SHA1 Message Date
matamatanot
62ef872989
Change authors member and links (#14367) 2020-07-05 11:36:50 +02:00
Tom Dohnal
2a99f591c4
Ie11 polyfills (#13704)
This resolves https://github.com/vercel/next.js/issues/12713 and https://github.com/vercel/next.js/issues/12722
2020-07-04 10:38:23 +00:00
Tim Neutkens
eecc73702b v9.4.5-canary.28 2020-07-03 13:31:38 +02:00
Tim Neutkens
c5e1e48e5a
Replace extra source line in webpack 5 (#14793)
Co-authored-by: Joe Haddad <timer@zeit.co>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-03 13:30:52 +02:00
Darsh Patel
e84537f88e
add NextWebVitalsMetric type for reportWebVitals (#14675)
Fixes: #13512
Defined and exported type for `metric`  used in [reportWebVitals](https://nextjs.org/docs/advanced-features/measuring-performance)

```
export function reportWebVitals(metric) {
  if (metric.label === 'custom') {
    console.log(metric) // The metric object ({ id, name, startTime, value, label }) is logged to the console
  }
}
```

One can now do 
```
import { NextWebVitalsMetric } from 'next/app'
export function reportWebVitals(metric: NextWebVitalsMetric ) {
  if (metric.label === 'custom') {
    console.log(metric) // The metric object ({ id, name, startTime, value, label }) is logged to the console
  }
}
```
2020-07-03 03:36:13 +00:00
JJ Kasper
a0c683208a
Fix URL being updated with basePath for 404 page (#14740)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-02 11:11:57 +02:00
Jan Potoms
dd97c984b2
Convert link to function component (#14633)
Convert `Link` to a function component. Prefetch logic and memoized url formatting now meshes nicely with React hooks. Class methods were hoisted to module scope to preserve performance characteristics.
2020-07-02 04:53:17 +00:00
JJ Kasper
dc49cd33eb
Update warning for rewriting to auto-export dynamic pages (#14751)
Since the no-op rewrite is a valid rewrite used to check pages/assets before adding a 404-rewrite this makes sure we don't show the rewriting to auto-export dynamic pages warning from it

Closes: https://github.com/vercel/next.js/issues/14736
2020-07-02 04:12:41 +00:00
Jan Potoms
066a18ffc8
Fix basepath root handling (#14756)
Fixes https://github.com/vercel/next.js/issues/14734
2020-07-02 03:48:10 +00:00
Tim Neutkens
9e83ba8cf6 v9.4.5-canary.27 2020-07-01 20:49:52 +02:00
Tim Neutkens
c5cc6072d0
Use single webpack runtimeChunk for Node.js compilation (#14722)
Webpack 5 supports a single runtimechunk for the Node.js compilation, this solves sharing modules between entrypoints.
2020-07-01 15:34:00 +00:00
Tim Neutkens
260707de68
Add etag support for getServerSideProps/getStaticProps pages (#14760)
Fixes #11711

Also cleaned up some extra code.

This was already supported on the Vercel edge network.
2020-07-01 14:59:18 +00:00
Lindsey Simon
68f4680549
Update index.js (#14771)
Fix CSS `display` on login link.
2020-07-01 14:40:22 +00:00
muslax
401f1b5560
Update README.md for next-auth-example (#14763) 2020-07-01 11:02:18 +00:00
JJ Kasper
4a107b6994
v9.4.5-canary.26 2020-06-30 17:21:24 -05:00
JJ Kasper
dd644945ea
Fix encoding for env files in serverless mode (#14750)
This makes sure to base64 encode the `.env*` file contents before passing them in the URL for the serverless-loader since `!` is a special character in this case which can cause webpack to fail to build

Closes: https://github.com/vercel/next.js/issues/14749
2020-06-30 21:33:37 +00:00
Luis Alvarez D
bfd1ecc370
Update environment-variables example (#14653)
Updated the example to use server only variables inside `getStaticProps`
2020-06-30 20:36:13 +00:00
Joe Haddad
cbb1c5c755
v9.4.5-canary.25 2020-06-30 11:54:20 -04:00
Darsh Patel
098d77c316
fix extra char in readme cms-sanity (#14725)
Fix super minor typo in cms-sanity example readme
2020-06-30 15:38:28 +00:00
Joe Haddad
ea1f45a388
Add no-anon-default-export Babel lint rule (#14519)
Fixes #12291 

![image](https://user-images.githubusercontent.com/616428/85499698-176b4900-b5b0-11ea-8a5d-a7f0b4c20307.png)
2020-06-30 13:05:29 +00:00
Darsh Patel
1b5ca78810
Example with Monogdb ReamlWeb (#14555)
Added an Example using MongoDB's Realm-Web SDK 

![Screenshot 2020-06-25 at 5 25 49 PM](https://user-images.githubusercontent.com/11258286/85715292-ebafa680-b708-11ea-98bd-d8d64701f0af.png)


Fixes #14417
2020-06-30 09:50:44 +00:00
Yang Sun
a8d2c1ee95
modify global css import error message (#14639)
Fixes #14464
2020-06-30 05:25:02 +00:00
Jan Potoms
ab7010711f
Avoid pulling extra code in the bundles for trailingSlash logic (#14696)
* avoid pulling code in the bundle for `trailingSlash` logic when it's not enabled
* avoid cloning the url an extra time if normalizing the path doesn't change it
2020-06-30 04:06:39 +00:00
Jan Potoms
6ff3a63a2e
Fix link to file url behavior with trailingSlash (#14681)
Avoid trailing slashes on urls that look like files. The redirect for `trailingSlash: true` will now look like:

```
Redirects

┌ source: /:path*/:file.:ext/
├ destination: /:path*/:file.:ext
└ permanent: true

┌ source: /:path*/:notfile([^/.]+)
├ destination: /:path*/:notfile/
└ permanent: true
```

The default still looks like:

```
Redirects

┌ source: /:path+/
├ destination: /:path+
└ permanent: true
```
After this gets merged, I have a few optimizations planned on the normalization code that should reduce the client bundle a little and that consolidates the `trailingSlash` and `exportTrailingSlash` options
2020-06-30 02:25:12 +00:00
ralphilius
2ad0b5ba4a
Fix NextSeo example (#14643) 2020-06-29 22:25:05 +00:00
Joe Haddad
af901f4366
v9.4.5-canary.24 2020-06-29 17:31:30 -04:00
Joe Haddad
923afd68d4
Upgrade CSSNano Version (#14638)
Fixes #14632
Fixes #14690
2020-06-29 21:29:53 +00:00
Arsalan Khattak
6079dc243b
Fetch Data on Runtime (with-MongoDB-mongoose example) (#14674)
Change Data Fetching Method in Example with-mongodb-mongoose
Fetch Data on Runtime (getServerSideProps) rather than Build Time (getStaticProps)
2020-06-29 16:45:24 -04:00
Joe Haddad
ac5b2acd12
Fix dynamic route encoding for NextLinks (#14281) 2020-06-29 16:44:43 -04:00
Pascal Pixel
c9bc101df8
[examples/with-three-js] Component with useLoader can use dynamic import (#14648)
The existing example gives an error on every hot reload, perhaps because of the way that an initial `useEffect` hook imports the `GLTFLoader` and it doesn't redo that on hot reload?

Putting the component using the `useLoader` hook in a dynamic import seems to fix this.

Open to better suggestions, this is kind of awkward to use still...
2020-06-29 20:14:58 +00:00
Joe Haddad
1d0e7a8a9a
Enable Optional Catch-All by Default (#14687)
Closes #14682
2020-06-29 18:50:32 +00:00
JJ Kasper
f12a9f92f8
v9.4.5-canary.23 2020-06-29 10:45:40 -05:00
JJ Kasper
89ca0d10d4
Update to use getDataHref in fetchNextData (#14667)
This updates `fetchNextData` to re-use the `getDataHref` function from `page-loader` which has more verbose handling to ensure the correct `/_next/data` URL is built. Re-using this logic ensures the `/_next/data` URL can still be built even when a mismatching `href` and `as` value is provided to `next/link`.

This also fixes a case in `getDataHref` where optional values that weren't provided would fail to build the data href since the check requiring the param be present while interpolating the route values hasn't been updated to allow missing params for optional values.

An additional test case has been added to the prerender suite to ensure the `/_next/data` URL is built correctly when mismatching `href` and `as` values are provided

x-ref: https://github.com/vercel/next.js/discussions/14536
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-31160
Closes: https://github.com/vercel/next.js/issues/14668
2020-06-29 15:14:45 +00:00
Jan Potoms
b8a30bab55
Handle trailing slashes, even when query parameters (#14650)
Add tests and fix for when the url contains query parameters.
`router` now uses the same method for formatting url+as pair as `Link`, will be able to share code after https://github.com/vercel/next.js/pull/14633 is merged
2020-06-29 14:50:45 +00:00
Tim Neutkens
327f6eed41
Clean up plugins (#14676)
Preparation for a larger rewrite
2020-06-29 14:26:49 +00:00
Tim Neutkens
83de34239c
Convert incremental generation cache to a class (#14660)
We've been meaning to change this code for a while 👍

- Changed the name from spr to incremental
- Changed the code to be a class instead of using module scope variables
2020-06-28 20:58:43 +00:00
Jan Potoms
14f1a7b27a
Positive req/seq change is not a warning (#14640)
Tweak PR stats message for req/sec metrics. I think they should warn when they are negative, not when positive
2020-06-28 15:47:44 +00:00
Luis Alvarez D
a04fdc8475
Add Environment Variables Example (#14575)
Closes https://github.com/vercel/next.js/issues/14570
Closes https://github.com/vercel/next.js/issues/14576

- The example features everything on the page in our docs while still being quite simple
- Added a link to it in the documentation
- Deprecated the with-now-env example
2020-06-28 11:57:33 +00:00
S M Mahmudul Hasan
874378dcb5
Add @prefresh/next to dependencies of preact example (#14649)
Add @prefresh/next as dependency

Closes #14607
2020-06-28 11:41:16 +00:00
Todor Totev
1aed9eaac1
Introduce react profiling production flag (#13873)
Closes [13709](https://github.com/vercel/next.js/issues/13709).

The solution works, **(tested and confirmed with true and false flags with the latest next version)** though I am quite sure this is not the most elegant and proper way to implement it. I have spent the good part of yesterday and today's morning in order to make it more generic but since it's my first time working with anything related to webpack I have struggled miserably. Last, but not least I'm unsure if this is the most proper naming for the flag.

Please, let me know what you want me to change and I'll get it done asap.
2020-06-28 11:23:29 +00:00
Tim Neutkens
479c38d3b7 v9.4.5-canary.22 2020-06-27 20:39:52 +02:00
Luis Alvarez D
0f60377967
Updated exportPathMap docs (#14630)
Closes https://github.com/vercel/next.js/issues/14596
2020-06-27 17:33:49 +00:00
Tim Neutkens
b4b68c0b85
Use assetEmitted hook instead of afterEmit (#14626)
Makes sure this works correctly with webpack 5.
2020-06-27 17:16:55 +00:00
Jan Potoms
bd24b70d60
Fix trailing slash handling in exporting pages with getStaticPaths (#14620)
Fixes https://github.com/vercel/next.js/issues/14573
2020-06-27 11:59:27 +00:00
Tim Neutkens
3909c76cef v9.4.5-canary.21 2020-06-27 13:11:08 +02:00
S M Mahmudul Hasan
09b2a66f49
Tailwind config: also look for .tsx .jsx and .ts (#14621)
Closes: #14595
2020-06-27 11:08:10 +00:00
JJ Kasper
61b68730f8
De-experimentalize custom-routes (#14602)
This moves the custom-routes configs outside of the experimental section to prepare them for being made stable

Fixes: https://github.com/vercel/next.js/issues/14184
2020-06-27 09:18:18 +00:00
James Bowes
166834e578
Update the passHref link (#14584)
Keeping up with section headers in markdown is fun :)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-26 11:08:48 -05:00
matamatanot
87bb11c98c
Remove next-cookies and prop-types (#14579) 2020-06-26 14:55:32 +02:00
Tim Neutkens
8393869912 v9.4.5-canary.20 2020-06-26 12:05:38 +02:00