Open
Description
The transformer works great, but I noticed it puts the JS code twice in the inclusion view. This doesn't prevent the transformer from working, but generates extra unnecessary code in the final HTML.
For instance, I created this in a Laravel Controller:
Javascript::put([
'application' => [
'name' => config('app.name', 'Laravel'),
],
'user' => [
'name' => $user->name,
]
]);
And this is what I get in the HTML:
<script>
window.reactBinding = window.reactBinding || {};
reactBinding.application = {"name":"AppName"};
reactBinding.user = {"name":"Kemmer-Legros"};
</script>
<script>
window.reactBinding = window.reactBinding || {};
reactBinding.application = {"name":"AppName"};
reactBinding.user = {"name":"Kemmer-Legros"};
</script>
Not big thing in my case, but if you are trying to send a big amount of information from Laravel to JS it could become an issue.
Metadata
Metadata
Assignees
Labels
No labels