Commit graph

3699 commits

Author SHA1 Message Date
Joe Haddad
21fae5262f
Reuse router logic instead of duping in client (#7476) 2019-05-30 15:44:27 -07:00
Joe Haddad
06e0befd82
Do not leave Promise unresolved (#7475) 2019-05-30 14:57:10 -07:00
Joe Haddad
3f9e64f7c1
Remove old optional dynamic <Link> test (#7474) 2019-05-30 14:05:06 -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
Jan Potoms
6ffd4564c5 Improve contributing doc without yarn link (#7471) 2019-05-30 11:58:55 -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
JJ Kasper
598cce8711 Don't run standard for tsx files in husky to match lint-fix (#7463)
* Don't run standard for tsx files in husky to
match lint-fix

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <timer150@gmail.com>
2019-05-29 17:53:35 -07:00
Joe Haddad
ec385e573d
Disable optional param routing code paths (#7459)
* Disable optional param routing code paths

* Fix tests
2019-05-29 14:29:02 -07:00
Tim Neutkens
c8a4682d4a
Remove react-ssr-prepass as it’s only needed for experimental feature (#7455)
* Remove react-ssr-prepass as it’s only needed for experimental feature

* Add react-ssr-prepass to devdeps
2019-05-29 15:19:21 +02: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
Matthew Webb
9ccbb1f5bf Correctly pass props down in with-lingui example HOC (#7445)
* correctly pass props down in Lingui example HOC

The WithLang HOC provided as part of the with-lingui example does not pass props down to the wrapped component.
This means that the result of getInitialProps is not passed to the page component.
This commit passes all props which aren't specific to the HOC implementation down to the wrapped component.

* remove semicolon to satisfy lint rules
2019-05-29 10:43:47 +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
Joe Haddad
c7276bcbef
Run lint-fix 2019-05-28 16:06:13 -07:00
JJ Kasper
7fe7648f7b Add tests for build activity indicator (#7448) 2019-05-28 14:21:31 -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
Matthew Sweeney
0cd2732c7f
Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -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
msheakoski
2c7be96daa Update Tailwind CSS to v1.0 (#7421) 2019-05-27 13:22:26 +02:00
XBOY
0ee2bcc962 Fix duplicate dynamic chunks (#7425) 2019-05-26 18:17:08 -07:00
Joe Haddad
51b9eabe40
Refactor server router (#7431)
* Format next server

* Extract findPageComponents logic from renderToHTMLWithComponents

* Apply a little formatting

* Lift up component loading
2019-05-26 14:22:43 -07:00
JJ Kasper
77b23264bb Opt out of cache header if _app has custom getInitialProps (#7409)
* Opt out of cache header if _app has custom
getInitialProps to match autoExport behavior

* Fix wrong component

* Add test for cache header
2019-05-23 20:24:02 -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
Nathan Sculli
43dcb594c2 New Example: with-reasonml-todo(#7346) 2019-05-23 16:48:13 -05:00
Nathan Sculli
5c678537d6 [with-reasonml] Show both internal and shared state managment. (#7312)
* Show both internal and shared state managment in example.
* Add a global state custom hook.
2019-05-23 16:46:42 -05:00
James Russo
ae8363c33e Create with-redux-persist example (#7375) 2019-05-23 15:13:48 -05:00
JJ Kasper
bb46c0673b
v8.1.1-canary.37 2019-05-23 14:59:12 -05:00
JJ Kasper
4ba6447e40
Don't load from serverless in dev mode (#7416) 2019-05-23 14:47:57 -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
Resi Respati
ed0e17503e [custom-server-typescript] fixed custom server build issues (#7385) 2019-05-23 14:08:03 -05:00
JJ Kasper
091a81e659
Revert fs-extra upgrade due to issue in latest version with jest (#7414)
* Remove async from describe callback
2019-05-23 11:53:28 -05: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
JJ Kasper
3adaafe783
Make sure rendering behavior is only changed when autoExport is enabled (#7408) 2019-05-22 16:16:03 -05: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
terry chay
c0e4b56fdb Update to latest webpack-bundle-analyzer (#7389) 2019-05-21 19:12:25 -05:00
Resi Respati
28b020538a [with-typescript] Remove obsolete TypeScript plugin and updated readme (#7368)
* [with-typescript] Remove obsolete TypeScript plugin and update readme
2019-05-21 12:30:17 -05:00