Commit graph

747 commits

Author SHA1 Message Date
Tim Neutkens
e49e442796
Clean up _document documentation (#7523) 2019-06-06 15:09:20 +02:00
Luc
3b5f18495b Replace recursive-copy with own implementation (#7263)
* replace recursive-copy with own implementation

* update yarn.lock

* do not filter out not directories

* do not fail if folder already exists

* replace `\` by `/` when sending pathes to filter

* use fs-extra only in tests

* investigate and test recursive-copy npm module

* improve test by creating fixtures programmatically

* remove recursive-copy npm module test

* add recursive-copy to bench

* add bench:recursive-copy script

* fix Sema import in recursive-copy.ts

* small improvements
2019-06-06 12:33:11 +02:00
JJ Kasper
e3cd31df17
v8.1.1-canary.46 2019-06-05 20:11:06 -07:00
JJ Kasper
be02b881c5
Fix auto export in serverless (#7517)
* Fix nextExport not being set in serverless

* Add test for refreshing query
2019-06-05 19:37:58 -07:00
JJ Kasper
66fd87fc9b
v8.1.1-canary.45 2019-06-05 13:26:13 -07:00
JJ Kasper
2bb2b57395
Fix autoExport on windows and add tests (#7514) 2019-06-05 13:20:08 -07:00
Tim Neutkens
7e7f2c0a6d
Simplify a few parts of the codebase (#7506)
* Move client-side dev JS to dev folder

* Move eventsource polyfill

* Move source-map-support

* Move error boundary

* Deprecate Container in _app

* Make initialRender check better

* Remove unused code

* Only support one subscription as there is only one

* Don’t spread object

* Shorten property name

* Add container in development too

* Simplify query update logic
2019-06-05 20:15:42 +02:00
Lukáš Huvar
c821e83048 API interface extensions (#7363)
* Cookies and Query parsing for API request

* Adding JSON and SEND

* First body parsing

* Body parsing

* Remove extra try catch

* Fix tests

* Only server bundling for API routes

* Update packages/next-server/server/api-utils.ts

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Revert on demand server changes

* Use content-type for parsing

* Update packages/next-server/server/api-utils.ts

Co-Authored-By: Jan Potoms <potoms.jan@gmail.com>

* Add tests for server compilation

* Add body limit

* Change API to function chaining

* Limit test
2019-06-05 13:22:09 +02:00
JJ Kasper
93aaacd58d Fix serverless dynamic routes (#7505)
* Fix serverDir resolving for autoExporting

* Fix dynamic routes in serverless loader
2019-06-05 13:18:23 +02:00
JJ Kasper
9fa1101c7c
v8.1.1-canary.44 2019-06-04 22:20:05 -07:00
JJ Kasper
7d5556a552
Fix serverDir resolving for autoExporting (#7504) 2019-06-04 22:17:36 -07:00
Kuba Juszczyk
02551d3bc7 Disable <title/> warning when React Helmet is used (#7483) 2019-06-04 22:30:29 +02:00
Dmytro
cc6eecd23f Allow to describe initial props in the NextPage type (#7491) 2019-06-04 09:35:13 -05:00
JJ Kasper
79cf929b25
v8.1.1-canary.43 2019-06-02 02:48:05 -07:00
JJ Kasper
3245a57370
Remove .includes from _app for ie compatibility (#7482) 2019-06-01 04:40:56 -07:00
JJ Kasper
875b205b57 Upgrade to latest typescript (#7477) 2019-05-31 04:36:59 -07:00
Joe Haddad
f8e9cbba7b
Consolidate import statements 2019-05-31 02:27:56 -07:00
JJ Kasper
a7a59450a5
v8.1.1-canary.42 2019-05-30 17:36:29 -07:00
JJ Kasper
8a8cde1b39
Refresh query on mount for exported pages (#7462)
* Refresh query on mount for exported pages

* Make sure to only refresh query if it is different

* Only update if search isn't empty

* Merge pre-rendered query values with
current query values

* Remove dynamic restriction for autoExporting

* Update dynamic routing test fo autoExport

* Remove autoExport from client-navigation test

* Remove logs and update trailing slash config

* Update nextExport tests in client-navigation

* Disable autoExport in export suite
2019-05-30 17:34:05 -07:00
JJ Kasper
da6791e1f1
v8.1.1-canary.41 2019-05-30 15:55:09 -07:00
Joe Haddad
c782fa4130
Revise dynamic route generation (mark 3) (#7473)
* Revise dynamic route generation
This implements a new tree-based route sorting algorithm that uses a Depth-First-Traversal approach to correctly sort the routes.

This provides better clarity over a `.sort()` based approach and will scale well as we add new features in the future.

* Update import
2019-05-30 13:42:45 -07:00
JJ Kasper
03d589349a
Render valid optimized AMP by default (#7465)
* Upgrade to latest AMP toolbox optimizer

* Remove amphtml from AMP only and update tests

* Update tests

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <timer150@gmail.com>
2019-05-29 19:53:41 -07:00
JJ Kasper
683a634a1e
Make react-ssr-prepeass external if not enabled (#7466) 2019-05-29 19:40:23 -07:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00
Tim Neutkens
3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02:00
Joe Haddad
5e2e9784e0
Do not force noEmit option into TypeScript configuration (#7451) 2019-05-28 19:01:49 -07:00
JJ Kasper
24034ec957 Add amp.canonicalBase option to set absolute URL (#7262)
* Add canonicalBase config to allow setting
absolute path for canonical link

* Make sure canonicalBase is set for
export and serverless

* Move canonicalBase to amp.canonicalBase

* Update tests with canonicalBase config

* Update tests

* run lint-fix

* Fix canonicalBase config parsing

* Fix canonicalBase during export

* Update amphtml tests
2019-05-28 17:32:17 -07:00
JJ Kasper
26702a8562
v8.1.1-canary.40 2019-05-28 12:49:23 -07:00
Joe Haddad
b6dd463d93 Enable strict export presence in webpack (#7446) 2019-05-28 12:43:07 -07:00
Rafael Almeida
5fa01b15c6 Improvements to build watcher (#7441)
* Remove fragment from _document

* Directly assign id instead of setAttribute

* Remove getElementById call by using the existing reference
2019-05-28 20:16:29 +02:00
Lukáš Huvar
e76529a499 Bundle only server code for API routes (#7443) 2019-05-28 15:48:13 +02:00
keustma
eee19788e5 Fixed typo in README.md (#7438) 2019-05-28 14:01:46 +02:00
JJ Kasper
d103828c8e
v8.1.1-canary.39 2019-05-27 15:03:53 -07:00
JJ Kasper
ca85cc9973
Update styles on build indicator container (#7436) 2019-05-27 15:01:29 -07:00
JJ Kasper
b5a93c9ac5
v8.1.1-canary.38 2019-05-27 14:07:05 -07:00
Rafael Almeida
6f6f40dba7 Implement UI to show building activity (#6526)
* Initial version of build watcher working

* Move build watcher div to Main component

* Add a better design, remove container from DOM when not visible

* Fix flickering when closing and opening too fast

* Add a field on next config file for two styles and completely removal

* Ops, bring back fade-in animation

* Remove unnecessary commas

* Render building text by CSS, remove unnecessary jsx attribute

* Remove React usage

* Add support to IE/Edge

* Fix linter issues

* Set custom property with data attribute

* Use ondemand: 1 to don't override current listeners

* Use more strict rules to avoid outside CSS effects

* Use lighter box shadow

* Fix registering HMR callback

* Move initializing build watcher to client/next-dev

* Remove buildWatcherStyle and only use minimal

* Move build watcher element to render

* Move it to create element on initialize

* Fix type error from canary

* Remove extra log

* Simplify SVG markup
2019-05-27 13:59:25 -07:00
Nat Welch
3f91f80ede
Allow passing of title to default error page (#7381)
* Allow passing of title to default error page

* Update README to include Error#title information

* Change title init location

* Update _error.js
2019-05-27 12:22:14 -07:00
Joe Haddad
e27203f89b Dynamic routing mark 2 (#7432)
* Update escape string regexp operators

* temp

* Extract getRouteRegex func

* First iteration of dynamic routing for production only

* Correctly order prod

* Add serverless support

* Single line it

* noop routes

* Format doc

* Fix dynamic routing for dev

* Add flag for dynamic routing

* Update packages/next-server/lib/router/router.ts

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

* remove example

* Add router tests

* Format code

* Sort routes

* Update to not use posix path methods
2019-05-27 11:20:33 -07:00
XBOY
0ee2bcc962 Fix duplicate dynamic chunks (#7425) 2019-05-26 18:17:08 -07:00
JJ Kasper
9a50e926e3 Add document middleware (#7209)
* Add document middleware

* Update tests

* Apply suggestions from code review

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-05-23 19:05:08 -07:00
JJ Kasper
bb46c0673b
v8.1.1-canary.37 2019-05-23 14:59:12 -05:00
Lukáš Huvar
bf294ee494
Types description (#7217)
* App, Document, Page, Error types description

* Router description

* Added head changed router

* Additions

* Fix examples

* Push and replace details

* Update packages/next-server/lib/head.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next-server/lib/utils.ts

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/types/index.d.ts

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_app.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-05-23 21:31:22 +02:00
Joe Haddad
98bed84688
v8.1.1-canary.36 2019-05-23 00:57:48 -07:00
Joe Haddad
f9f80dffe5
Upgrade dependencies (#7412)
* ⬆️ Upgrade workspace dependencies

* Run new prettier against examples

* Upgrade some next-server packages

* Upgrade Next.js dependencies

* Upgrade webpack deps

* Upgrade async sema

* Fix compilation

* Revert broken plugin
2019-05-23 00:52:36 -07:00
Joe Haddad
b6d3c1fd81
v8.1.1-canary.35 2019-05-22 09:47:34 -07:00
JJ Kasper
cdd54afb0d Add auto static/dynamic (#7293)
* Add automatic exporting of pages with no getInitialProps

* Add support for exporting serverless to static
and serving the html files during next start

* Fix missing runtimeEnv when requiring page, re-add warning
when trying to export with serverless, and update tests

* Update flying-shuttle test

* revert un-used pagesManifest change

* remove query.amp RegExp test

* Fix windows backslashes not being replaced

* Re-enable serverless support for next start

* bump

* Fix getInitialProps check

* Fix incorrect error check

* Re-add check for reserved pages

* Fix static check

* Update to ignore /api pages and clean up some tests

* Re-add needed next.config for test and correct behavior

* Update RegExp for ignored pages for auto-static

* Add checking for custom getInitialProps in pages/_app

* Update isPageStatic logic to only use default export

* Re-add retrying to CircleCi

* Update query during dev to only have values
available during export for static pages

* Fix test

* Add warning when page without default export is
found and make sure to update pages-manifest
correctly in flying-shuttle mode

* Fix backslashes not being replaced

* Integrate auto-static with flying-shuttle
and make sure AMP is handled in flying-shuttle

* Add autoExport for opting in
2019-05-22 09:36:53 -07:00
JJ Kasper
4718bd675f Document useAmp in readme (#7405) 2019-05-22 09:31:08 -07:00
Joe Haddad
dc1f907cec
v8.1.1-canary.34 2019-05-19 19:09:42 -04:00
Joe Haddad
931cd3d305
Reduce the maximum number of shuttles 2019-05-19 19:07:19 -04:00
JJ Kasper
3c3abcb6d1
v8.1.1-canary.33 2019-05-17 14:49:41 -05:00