Commit graph

3238 commits

Author SHA1 Message Date
Jason Miller
1b4b9a34ad Add a viewport meta tag by default (#6754)
* Add default viewport meta tag (fixes #6698)

* Do not inject default viewport when rendering an AMP document

* Remove redundant viewport on error page

* Plumb withSideEffect() to pass through props, then use that for isAmp.

* Add tests for viewport meta tag.

* Fix linting

* Update dedupes test
2019-03-27 11:46:44 -05:00
Joe Haddad
2efad5a2d8
v8.0.4-canary.25 2019-03-27 12:02:26 -04:00
Joe Haddad
b835e2589d
Specified page builds (#6796)
* [wip] individual page builds

* Make flag experimental and remove from main bin

* Do not split chunks when using shared runtime
2019-03-27 11:51:05 -04:00
Václav Nosek
02966afd5a [with-sentry] example: Make 'utils/sentry.js' more flexible (#6769)
* Make `ctx` optional in `captureException` function

* Make 'release' optional when calling sentry util

* Fix code style
2019-03-27 13:23:34 +01:00
Chris Cowan
1888467696 Improve with-google-analytics example (#6787)
The with-google-analytics example had the "routeChangeComplete" event listener set up in components/Page.js, but that the event listener would only be set up if the user visited a page using that component. From the example, it's not clear if google analytics can be used without making every page use a component like components/Page.js. Someone following the example may make pages that don't use components/Page.js and fail to have page views reported, or feel compelled to force a shared component into their design unnecessarily, or might even make a mistake by making multiple different components like Page.js which each add a new "routeChangeComplete" event listener, causing page views to be over-reported when the user navigates between pages using the different components.

This PR moves the "routeChangeComplete" event listener into _app.js, where it's guaranteed to be executed for every page and is more obviously decoupled from page-layout-related components.

This PR also fixes a React warning about the lack of an onChange handler on an input tag, and removes the unnecessary implementation of `getInitialProps` in _document.js (the default implementation is inherited if not present, there's nothing this example needs to do with `getInitialProps` specifically, and the body of the method seems to have been based on an old version of next's internal implementation).

This PR also fixes the url being passed to google tag manager incorrectly. It looks like page_path should be used instead of page_location because the `url` value only has the path, not the full url with the domain name, etc. (https://developers.google.com/analytics/devguides/collection/gtagjs/pages)
2019-03-27 13:21:41 +01:00
Luis Fernando Alvarez D
da9472246c Remove prop-types import in the build (#6798)
Tests don't catch this change because `isProduction &&` is always false so I tested it with a local build
2019-03-27 12:26:01 +01:00
Tomáš Hapl
99362592b9 example with orbit-components (#6793) 2019-03-27 01:49:12 +01:00
Corbin Crutchley
9504a389c0 Update dependencies of various examples (#6731)
Minor changes to examples. Updating major semver updates with only `package.json` changes. 
I've done my best to make sure that these packages.json files all have `latest` for the `nextjs` package, `cross-env` for those with `server.js` files, etc.
I also added a `package.json` to `with-dynamic-app-layout` (it was missing one previously)

Made sure to test all of these packages post-upgrade to ensure maintained functionality
2019-03-27 01:42:49 +01:00
JJ Kasper
244b0e700e
Add AMP validation on export (#6794)
* Add err.sh link and pool validation results
to wait to show error until export is finished

* Fix wording in amp-export-validation err.sh

* Update validation error message

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* Update ways to fix text

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* Update why the error occurred wording

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* Update wording some more

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
2019-03-26 16:21:27 -05:00
JJ Kasper
96c628409a
v8.0.4-canary.24 2019-03-26 11:31:48 -05:00
Joe Haddad
0249b331c2
Use a shared module cache (#6791)
* [WIP] Use a shared module cache

* ID modules in development

* Revert "ID modules in development"

This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63.

* Remove context replacement

* Only enable shared runtime in prod

* Sort settings

* Add shared runtime experimental setting

* only enable shared runtime in serverless
2019-03-26 12:30:31 -04:00
Luis Fernando Alvarez D
dbd41725ce Removed the X-Powered-By header (#6789)
Related to #6776
2019-03-26 12:32:01 +01:00
Michele Salvini
affe356a90 Pass mapDispatchToProps as an object (#6786)
wrapping `startClock` in `bindActionsCreator` there's no need to pass `dispatch` in:
```
this.props.startClock(dispatch)
```
Furthermore `bindActionsCreator` is not needed because following already bind actions:
```
const mapDispatchToProps = {
  startClock
};
```
2019-03-26 12:28:18 +01:00
Joe Haddad
1604862895
v8.0.4-canary.23 2019-03-25 12:18:42 -04:00
Joe Haddad
8c175e5daa Replace buildId well known string during output (#6782)
* Replace buildId well known string during output

* Fix linting
2019-03-25 17:06:00 +01:00
Joe Haddad
480fb5652a
Add @lfades to CODEOWNERS 2019-03-25 10:59:27 -04:00
Tim Neutkens
7788849ad5 v8.0.4-canary.22 2019-03-25 15:09:01 +01:00
Tim Neutkens
907dd27a88
Make main.js override work correctly (#6781) 2019-03-25 15:08:02 +01:00
Tim Neutkens
24d8ec560f v8.0.4-canary.21 2019-03-25 13:01:14 +01:00
Kristian Heruc
82314137d0 Add X-Powered-By info to the docs (#6775) 2019-03-25 11:53:46 +01:00
Tim Neutkens
cf73809cb9
Revert "Add static-no-js site example (#6770)" (#6774)
This reverts commit 879da36888.
2019-03-25 09:08:41 +01:00
Giuseppe
879da36888 Add static-no-js site example (#6770) 2019-03-25 09:04:47 +01:00
Connor Davis
a79c004de0 Remove magic-string (#6772)
* Remove magic-string

* Add back input

* change if statement back

* Fix typo

* remomve useless import
2019-03-24 23:50:58 -04:00
Tim Neutkens
3e7b932b2b
ncc resolve and arg (#6771)
More modules to follow.
2019-03-24 23:38:03 +01:00
Tim Neutkens
fa5125488b v8.0.4-canary.20 2019-03-24 14:34:44 +01:00
Tim Neutkens
f639becf88
Don't use array for main chunk (#6767)
* Simplify getDisplayName

* Don’t use array for single file

* Add aliases, drop htmlescape as it’s not longer in the codebase

* Add correct path

* Use the correct router

* Remove dynamic for now

* Mark as external as the modules are directly called

* Add comment explaining what this does
2019-03-24 14:33:10 +01:00
Tim Neutkens
a8d08d3920
ncc nanoid (#6768) 2019-03-24 14:21:30 +01:00
Tim Neutkens
355078c350
Separate toRoute function (#6766)
Because Typescript output is turned to commonjs for these modules currently it’s better to do this. Also convert withRouter to typescript, making it smaller.
2019-03-23 23:00:46 +01:00
Tim Neutkens
eb28d4cdcf
Remove hoist-non-react-statics from with-router (#6765)
* Remove hoist-non-react-statics from with-router

* Drop hoist-non-react-statics from package.json
2019-03-23 21:31:44 +01:00
Tim Neutkens
cf7f707ff9
Remove PropTypes from _error and next/dynamic (#6763)
* Remove proptypes

* Remove loadable capture in favor of React.createContext

* Add loadable context file

* Make sure we use the context value instead
2019-03-23 21:00:31 +01:00
JJ Kasper
e95030b582
Update to have default value for renderToHTML (#6755)
* Update to have default value for renderToHTML
options in dev mode

* Update test
2019-03-23 11:20:54 -05:00
Tim Neutkens
6716bcbf87
Remove error-debug.js checks as the chunk is removed (#6761)
This code is obsolete as the chunk was removed.
2019-03-23 16:55:44 +01:00
Tim Neutkens
d24af62140
Make pages-manifest-plugin compatible with webpack 5 (#6760)
Apparently `entries` is removed in webpack 5, using `chunks` instead which holds the same result.
2019-03-23 15:33:13 +01:00
Tim Neutkens
08b7a24925
Update local testing doc to show our own workflow (#6753)
As per https://twitter.com/pierrevanmart/status/1109030783405248513
2019-03-22 16:27:29 +01:00
Joe Haddad
efdbd87625
v8.0.4-canary.19 2019-03-21 22:47:57 -04:00
JJ Kasper
397674c40e Fix export not checking amp right for /index.amp (#6748)
* Fix export not checking amp right for /index.amp

* Add test checking hybrid amp index behavior
2019-03-21 21:40:42 -04:00
Joe Haddad
34be001749
v8.0.4-canary.18 2019-03-20 16:06:57 -04:00
JJ Kasper
5a48272af0 Fix amphtml href with nested amp page (#6741)
* Add more export tests for AMP

* Make sure ampPath is correct when nested

* Remove console.log
2019-03-20 15:22:08 -04:00
JJ Kasper
19f39511f4
v8.0.4-canary.17 2019-03-20 13:24:02 -05:00
JJ Kasper
20e4a5049e
Add more export tests for AMP (#6740)
* Add more export tests for AMP

* Remove console.log

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* remove extra line

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
2019-03-20 13:17:04 -05:00
Joe Haddad
773a3a21c5 v8.0.4-canary.16 2019-03-20 11:43:07 -04:00
JJ Kasper
e1cf32ca60 Update export tests and fixed import (#6738)
* Fix import in export worker

* Update export tests

* Turn test parallelism up

* Fix config in export-default-map

* Switch parallelism back to 3
2019-03-20 11:42:02 -04:00
Joe Haddad
b5880717e6
v8.0.4-canary.15 2019-03-20 09:21:21 -04:00
Tim Neutkens
130aa3fd18
Remove unused parameters (#6735)
These two were unused 👍
2019-03-20 12:11:35 +01:00
JJ Kasper
7d0919a784 Break up basic test suite (#6730)
* Break out client-navigation and rendering
test from basic test

* Try with parallelism dialed back to 3

* Update jest-junit for more compatible timings in CircleCI

* Bump to test timings

* Use filepath for suitename in jest-junit

* Store reports as artifacts

* Try using classname for timings

* Bump

* Remove reports from artifacts
2019-03-20 11:01:32 +01:00
Connor Davis
2c975b1cdc Catch errors when loading a page in case a script 404s (#6729)
* Catch errors when loading page

* return promise instead of await
2019-03-20 10:58:26 +01:00
JJ Kasper
18af71c011 Add support for amp to export (#6725)
* Add support for amp to export

* Anchor canonical replace

* Disable profiling test for now

* Centralize amp utils to next-server/server/utils

* re-enable profiling test
2019-03-19 23:53:47 -04:00
Joe Haddad
e906e4bd77
Adjust CircleCI flow (#6728)
* Format circleci config

* Tweak configuration into multiple steps

* Persist whole repo to workspace

* Attach workspace for tests

* Run tests in parallelism x4

* Test circleci parallelism

* parallel x6 times

* Save test timing

* Use env var instead

* run in ci mode

* test speed
2019-03-19 21:55:43 -04:00
Joe Haddad
78bcfa07b2 Skip console clearing when not in a TTY (#6726) 2019-03-19 23:16:02 +01:00
Joe Haddad
31f6f4c606
Ensure browser gets closed during testing (#6724)
* Ensure browser gets closed during testing

* Remove fit
2019-03-19 18:03:50 -04:00