Commit graph

1017 commits

Author SHA1 Message Date
Julien Bouquillon
1007777471 doc: typo fix (#8460)
* doc: typo fix

* fix glitch
2019-08-21 14:38:14 +02:00
Joe Haddad
f41f630d19
v9.0.5-canary.0 2019-08-20 17:25:46 -04:00
JJ Kasper
9c8aaf9d4b Fix build-manifest not removing _app files for modern (#8447) 2019-08-20 15:32:03 -04:00
Jason Miller
8bd2e433de Initial optimizeLibraries experimental flag (#8345)
* Add experimental optimizeLibraries flag, currently prunes Moment.js locales

* expose moment for use in assertion

* try with the same setup as the production integration test

* Apply optimiztaions in dev and on server so they're consistent.

* fix build (oh dear)

* Update index.test.js

* Rename flag to future.excludeDefaultMomentLocales

* Adjust impl
2019-08-20 15:19:45 -04:00
Lukáš Huvar
f0b6d0a1e2 Fix custom page extension in development (#8446)
* Fix page extension in development

* Remove un-used file

* Fix standard
2019-08-20 13:38:30 -04:00
Joe Haddad
5ad0ea8e5b
Remove __NEXT_REPLACE__BUILD_ID__ workaround (#8445)
We no longer need this because we don't run terser on serverless bundles.

---

Closes https://github.com/zeit/next.js/issues/8436
2019-08-20 12:38:14 -04:00
Joe Haddad
847e892d71
Remove Flying Shuttle experiment (#8433)
* Remove Flying Shuttle experiment

* Remove more old tests

* Remove minify loader
2019-08-20 11:07:57 -04:00
Lukáš Huvar
0e01435f64 Change FAQ for dynamic routing (#8439) 2019-08-20 14:40:13 +02:00
Joe Haddad
df4f600291
🗜 Optimize client-side routing manifest (#8429)
* Optimize client-side routing manifest

* Turn on granularChunks for tests

* Add row for build manifest

* Hack it
2019-08-20 02:28:09 -04:00
Maël Nison
a8aa15af11 Adds basic support for PnP (#8427)
* Adds basic support for PnP

* Update preset.ts

* Update next-babel-loader.js
2019-08-19 23:39:07 -04:00
paulogdm
2ab5c86641 Update Zones Documentation (#8426)
* Update README.md

Small typo reported on Spectrum. Kudos to @borekb

* Update packages/next/README.md

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update packages/next/README.md

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update packages/next/README.md

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update README.md

* Update README.md
2019-08-19 19:43:01 -04:00
JJ Kasper
144eecd185 Add example with forwardRef to readme (#8428) 2019-08-19 17:17:31 -04:00
JJ Kasper
37c666976f
v9.0.4 2019-08-19 14:53:54 -05:00
JJ Kasper
8c26a08c9e
v9.0.4-canary.8 2019-08-19 12:45:10 -05:00
William
ec95927e14 Fix dynamic APIs with query params (#8386)
* Fix dynamic APIs with query params

If you define a dynamic API such as

```
pages/
  api/
    [id].js
```

This api becomes available at `/api/[id]`. If you send a request with
a query parameter the value of `req.query.id` will include the query
string as well as the path parameter.

E.g. the request to `/api/2?test=123` will result in `req.query`
being

```javascript
{
  id: "2?test=123",
  test: "123",
}
```

instead of

```javascript
{
  id: "2",
  test: "123",
}
```

* Fix url parse in serverless loader

* Add serverless test
2019-08-19 13:19:39 -04:00
undirectlookable
177524be8e Fix conflict between defaultPathMap and default 404.html export (#8366)
* Fix conflict between defaultPathMap and default 404.html export,if have a page in pages/404.js

* Update packages/next/export/index.js

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* add test export-override-404
2019-08-19 10:16:00 -05:00
Ondrej Sika
d7a6cddde6 next/bin/next - fix typo in help text (#8419) 2019-08-18 23:50:20 +02:00
JJ Kasper
b2b5ece322
v9.0.4-canary.7 2019-08-18 14:52:22 -05:00
Tim Neutkens
46c4f20cd3
Add custom profiler / tracer (#8378)
* Add custom profiler / tracer

This captures both client/production builds and everything before and after is cpu profiled, which makes sure that the whole process instead of just webpack is included in the final report.

* Update tests

* Update profiling-plugin.js

* Rename profiling-plugin.js to profiling-plugin.ts

* Update profiling-plugin.ts

* Update and rename profiling-plugin.ts to profiling-plugin.js

* Update webpack-config.ts

* Update profiling-plugin.js

* Add types

* Add missing type

* Add back TypeScript linting

* Remove tracing-js
2019-08-18 21:45:39 +02:00
knight-of-zero
ad77a55063 Fixed the docs. The real option is compress, not compression (#8409) 2019-08-17 19:40:51 -05:00
JJ Kasper
308c2cd4bc
v9.0.4-canary.6 2019-08-16 12:55:46 -05:00
Joe Haddad
a04a5f014a
Remove extra DOM method call (#8394) 2019-08-16 12:00:46 -04:00
Brian Rayburn
cbe70e95a8 Update README.md (#8392)
change `||` to `&&` in Router.beforePopState example to match doc description
2019-08-16 09:57:42 -05:00
Jason Miller
d8fe224951 Hook destructuring optimization (#8381)
* Add hook destructuring optimization

* oops, accidentally included loose mode

* inline hook destructuring optimization plugin

* fix test nesting

* fix lockfile

* allow any react hook

* Add page to stats-app with hooks
2019-08-15 18:08:06 -04:00
Jason Miller
cfd6080435 Feature: Add transparent JSX optimization (#8350)
* Add transparent JSX optimization.

* fix duplicate React import

* fix React not being imported when only a single Fragment node is present in a source module

* remove babel-plugin-react-require

* Fix JSX optimization for CommonJS source files.
2019-08-15 17:07:34 -04:00
Joe Haddad
771c0b450e
Use data-next-page instead of id=__NEXT_PAGE__ (#8380) 2019-08-15 13:56:26 -04:00
Luis Fernando Alvarez D
0b15540a48 Don't look up for TS files in dev (#8374)
* Only read for typescript files if there's no tsconfig

* Update verifyTypeScriptSetup.ts

* Remove the recursive check for TS files

* Remove unused import

* Updated tests

* Add a check for the content of tsConfig

* Clean up

* utf8
2019-08-15 11:27:02 -04:00
Prateek Bhatnagar
cffa2e3f21 Reverting clear measure (#8373) 2019-08-15 08:14:09 +02:00
Joe Haddad
d3f25ccbc5
v9.0.4-canary.5 2019-08-14 14:15:43 -04:00
Joe Haddad
3c611822ab
Create a unique instance of transform-define (#8371) 2019-08-14 14:10:55 -04:00
Joe Haddad
2d810950b2
v9.0.4-canary.4 2019-08-14 12:18:44 -04:00
William Li
a15e22e829 updated links from #useRouter to #userouter (#8362)
Links pointing to #useRouter doesn't work. They need to be #userouter
2019-08-13 23:04:42 -04:00
Joe Haddad
5a8ed815fc
Define typeof window for application code only (#8355) 2019-08-13 22:02:53 -04:00
Iurii Kucherov
99f2d2a109 Add a note for multiple dynamic route segments (#8359)
* Update README.md

* Update README.md

* Update README.md

* Update README.md
2019-08-13 21:35:27 -04:00
JJ Kasper
d9abbaded1 Remove experimental async-to-promises code (#8353) 2019-08-13 16:04:17 -04:00
JJ Kasper
9fe95b5c7d Add note explaining empty query during prerendering (#8351) 2019-08-13 19:58:45 +02:00
Spencer Elliott
de4e16bf72 Add missing dependency "compression" to next-server (#8344)
* Add missing dependency "compression"

* Remove "compression" dependency from next
2019-08-13 12:03:50 -04:00
Houssein Djirdeh
55ccb09dee fixes nav start argument in user timing check (#8348) 2019-08-13 11:48:30 -04:00
JJ Kasper
8c19d78a08 Also provide AppTree in NextPageContext (#8223)
* Also provide AppTree in NextPageContext

* Don't predefine AppTree as null in ctx

* Make update smaller

* Don’t reassign variable

* Add test for AppTree in NextPageContext

* Update utils.ts
2019-08-13 11:33:48 +02:00
Lukáš Huvar
7e1d54cc09 Add warning for disabled minification during build (#8337)
* Add warning for disabled minification

* Adding err.sh

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Remove example

* Update packages/next/build/index.ts

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Update index.test.js
2019-08-12 23:13:12 -04:00
Alex Castle
3b31f957a1 Use 'initial' setting for SplitChunksPlugin (#8293)
* Use 'initial' setting for SplitChunksPlugin

* Initial chunking integration test shell

* Create integration tests for granular chunks build output
2019-08-12 20:35:33 -04:00
Joe Haddad
bc9f2b6139
Minify ncc'd packages for download speed (#8341) 2019-08-12 17:31:07 -04:00
Joe Haddad
df30f5e4b6
🐛 Support multiple Next.js versions in one file (#8339) 2019-08-12 16:53:11 -04:00
Joe Haddad
8d219c2371
Detect @types/ package for compiled packages (#8340) 2019-08-12 16:29:42 -04:00
Joe Haddad
ab0384deef Fix TypeScript setup with empty file (#8332)
New versions of TypeScript now throw an error when no matching TypeScript files are found. We still want to setup in this case.

-----

Closes #8324
2019-08-12 11:40:53 +02:00
Natalie Marleny
06876f1be0 fix: Warn when user specifies prefetch option as true (#8233)
* Warn when user specifies prefetch option as `true`

* Update index.test.js
2019-08-12 00:26:25 -04:00
Joe Haddad
6b516f6c84
Remove accidental support for invalid JavaScript (#8077)
* Remove accidental support for invalid JavaScript
Next.js inadvertently supported users mixing ES Modules and CommonJS due to a Babel bug that was fixed in v7.
This removes the hack in favor of the new Babel `sourceType` feature.

**This will result in broken code for users who relied on this non-standard conforming behavior.**

* Fix comment

* Toggle feature behind modern flag
2019-08-12 00:10:12 -04:00
JJ Kasper
77c5e36ba7 Escape output names for modern bundles to prevent replacing (#8232)
* Escape output names for modern bundles

* Update escaping for modern bundle
2019-08-11 23:32:18 -04:00
Gerald Monaco
04cf779702 Add warning for missing <Head> (#8276)
* Add warning for missing <Head>

* Update the warning to be eliminated away in production

* Update head-manager.js
2019-08-11 22:48:05 -04:00
JJ Kasper
fc7e235f2c Followup optimizations for new experimentalPrerender (#8287)
* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Update dead code elimination
2019-08-11 21:56:57 -04:00