Add AmpBoilerplateErrorHandler transformer#1195
Add AmpBoilerplateErrorHandler transformer#1195sebastianbenz merged 4 commits intoampproject:mainfrom
Conversation
|
@sebastianbenz I don't know enough about the JS DOM abstraction to solve that. Any ideas on how to ensure no whitespace is added? |
|
The transformer is fine, we run a code formatter after the transformations (for readability) which adds the whitespace. You have to disable this, by adding You'll also have to run |
4054038 to
f632431
Compare
|
The CLA check seems to be stuck here... |
|
When disabling the beautify on scripts, it not only leaves the internals of each script tag intact, but it also removes the newlines between the individual elements. Is there a way to avoid styling the script internals, but keep the newlines outside of the script element intact? |
|
Not sure if that's configurable. I don't consider this a critical problem. |
This PR adds a transformer that adds a
<script amp-onerror>element to the document head to disable the boilerplate early on errors while loading the AMP runtime.Fixes #1146