Commit graph

20 commits

Author SHA1 Message Date
JJ Kasper
fdfbab5d25 Updated handling of AMP page reloading (#7052) 2019-04-16 18:04:41 -05:00
JJ Kasper
75a2c45f6a AMP fix escaped rel (#7045)
if `&amp=1` is used to point to the `amphtml` version of a page it get's escaped causing it to become `&amp=1` this fixes it to stay as `&amp=1`

Closes: #7038
2019-04-16 22:57:17 +09:00
JJ Kasper
11016221cd
Make sure AmpContext is available in _document (#7021)
* Make sure AmpContext is available during _document
render and update filtering of script tags in AMP mode

* Update amphtml test to make sure
AmpContext is set for _document render

* Fix stray comma in render.tsx
2019-04-12 19:04:52 -05:00
JJ Kasper
e5111745b5
Replace .amp.js with withAmp(Comp) (#7009)
* Add WithAmp to enable AMP support for
pages instead of .amp.js

* Update handling for exporting AMP

* Fix ampPath in export for / path and
revert isAmp logic to handle right

* Update amphtml test suite

* Add handling for noDirtyAmp during
export and update amp-export test suite

* Update serverless and export-default-map
test suites

* Update require-page tests
2019-04-11 13:59:26 -05:00
JJ Kasper
aac50e4501
Add error message for AMP bind syntax (#6865)
* Add error message for AMP bind syntax

* Fix custom AMP scripts getting dropped

* Add data.js to package.json to include it
in releases
2019-04-02 17:32:07 -05:00
JJ Kasper
6344c5f0c1
Add optimizing AMP pages (#6835)
* Added amp-toolbox-optimizer and added
optimizing AMP pages as dirty and clean

* Fix amp-optimizer breaking serverless build

* Exclude amp-toolbox-optimizer from serverless build

* Added check to make sure hybrid AMP pages
optimize cleanly during export

* Add check to make sure noDirtyAmp is applied
2019-04-02 13:01:34 -05:00
JJ Kasper
14eef58702 Re-add chromedriver retrying from previous webdriver setup (#6846)
* Re-add previous webdriver setup with falling
back to BrowserStack setup

* Add missing webdriver imports
2019-04-01 16:09:09 +02:00
JJ Kasper
26a4eb827c Add dropping of custom scripts in AMP mode (#6830)
Drops user `<script>` tags and shows a warning in AMP mode. Right now they are only dropped in production mode and left in dev mode so the validator shows its warning since it looks like conflicting props log messages are being cleared causing them to not show. 

Closes: #6688
2019-03-29 17:20:12 +01:00
JJ Kasper
533018f7d0 Update tests for BrowserStack (#6810)
Update tests to setup webdriver stuff in `jest-environment` and re-use one browser session instead of spawning one for each webdriver call to prevent creating too many BrowserStack sessions.
2019-03-29 16:05:53 +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
JJ Kasper
bce75ae9c3
Add checking for corresponding pages for link tags (#6719) 2019-03-19 14:01:42 -05:00
JJ Kasper
12cbb934b3 Add support for creating AMP pages (#6706)
* Add support for .amp.js pages and
resolving /page?amp=1 to page.amp.js

* Update amp tests

* Update example and clean up amp page resolving

* Add nested amp test

* page => normalizedPage

* Add type to page options

* Add handling of amp with all pageExtensions
and normalize page

* Make sure findPageFile only falls back to
amp if enabled
2019-03-18 23:24:21 -04:00
JJ Kasper
2d6a73cb66 Remove conflicting <head> tags in amp mode (#6693) 2019-03-18 12:29:31 +01:00
JJ Kasper
69b53bfc81 Remove sourceMaps from amp styles to not go over limit (#6674)
* Remove sourceMaps from amp styles to not go over limit

* Add test to make sure style sourceMaps
are removed in amp
2019-03-15 14:53:02 -04:00
Joe Haddad
330bedacc7 Add Babel plugin that fixes className for Amp elements (#6486)
This is a simple Babel plugin that overwrites certain attributes for `amp-` elements.
2019-02-28 23:04:29 +01:00
Joe Haddad
f15cfeba0a
AMP automatic page refreshing in dev (#6392)
* AMP page reload

* Fix comment

* Skip dev files in production

* Polyfill event source

* Add HMR test for AMP

* Use webdriver

* Use a dynamic server for HMR test

* ffs
2019-02-25 17:00:14 -05:00
Connor Davis
fcf1167cd4 Upgrade standard and fix files (#6358)
Upgrades `standard` to major version 12
2019-02-19 22:45:07 +01:00
Joe Haddad
ee18967dfc Add tests for AMP style tags (#6355)
Relevant commit: f913aabe16

~~I needed to upgrade Standard to work with JSX fragment syntax.~~ This caused too much noise so I just stopped using Fragments.
2019-02-19 16:37:19 +01:00
Joe Haddad
6dfcacb7bf
Use a query parameter for AMP pages instead of new route (#6336)
Per consensus in a mixed-application scenario, we'll use the `amp` query parameter convention.
2019-02-18 09:44:21 -05:00
Tim Neutkens
4051ffcb01 [experimental] Rendering to AMP (#6218)
* Add initial AMP implementation

* Implement experimental feature flag

* Implement feedback from sbenz

* Add next/amp and `useAmp` hook

* Use /:path*/amp instead

* Add canonical

* Add amphtml tag

* Add ampEnabled for rel=“amphtml”

* Remove extra type
2019-02-14 10:22:57 -05:00