Skip to content

Commit 8dca14f

Browse files
author
Ben Roberts
committed
include uuid as id in fallback html
1 parent 99bb725 commit 8dca14f

File tree

3 files changed

+137
-4
lines changed

3 files changed

+137
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"type": "library",
55
"require": {
66
"php": ">=5.6.0",
7-
"guzzlehttp/guzzle": "^6.2"
7+
"guzzlehttp/guzzle": "^6.2",
8+
"ramsey/uuid": "^3.5"
89
},
910
"require-dev": {
1011
"phpunit/phpunit": "^5.7"

composer.lock

Lines changed: 131 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Renderer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ protected function fallback($topLevelError, $jobs)
214214
*/
215215
protected function getFallbackHTML($moduleName, $data)
216216
{
217+
$uuid = \Ramsey\Uuid\Uuid::uuid4();
217218
return sprintf(
218-
'<div data-hypernova-key="%1$s"></div>
219-
<script type="application/json" data-hypernova-key="%1$s"><!--%2$s--></script>',
219+
'<div data-hypernova-key="%1$s" data-hypernova-id="%2$s"></div>
220+
<script type="application/json" data-hypernova-key="%1$s" data-hypernova-id="%2$s"><!--%3$s--></script>',
220221
$moduleName,
222+
$uuid,
221223
json_encode($data)
222224
);
223225
}

0 commit comments

Comments
 (0)