nova-proxy icon indicating copy to clipboard operation
nova-proxy copied to clipboard

Inject client scripts URLs from Hypernova response

Open marconi1992 opened this issue 5 years ago • 1 comments

Stack Overflow Question: https://stackoverflow.com/questions/61478514/is-there-a-way-to-have-the-client-side-script-also-auto-loaded-from-the-proxy-cl#

We should be able to return the client script URLs in the Hypernova response and inject the corresponding script tags when including the Nova views.

Example.

{
    "success": true,
    "error": null,
    "results": {
        "example": {
            "name": "Example",
            "html": "<div data-hypernova-key=\"Example\" data-hypernova-id=\"33719ec2-1b19-4023-8b2b-e82aa29990cc\"><h1 data-server-rendered=\"true\">Ara Framework</h1></div>\n<script type=\"application/json\" data-hypernova-key=\"Example\" data-hypernova-id=\"33719ec2-1b19-4023-8b2b-e82aa29990cc\"><!--{\"title\":\"Ara Framework\"}--></script>",
            "meta": {
                "src": "http://localhost:3000/public/client.js"
            },
            "duration": 0.36806,
            "statusCode": 200,
            "success": true,
            "error": null
        }
    }
}

Nova Proxy should include the next HTML element in the host page:

<script async src="http://localhost:3000/public/client.js" >

marconi1992 avatar Apr 28 '20 16:04 marconi1992

Hi @marconi1992 As mentioned in https://stackoverflow.com/q/64943789/14681547, I'm experiencing an issue which seems to be related to this answer

It therefore always seems compulsory to declare client.js scripts even if they are declared in the Nova Proxy. Is it this ? Yet it seemed to me to understand that the PR from April could resolve it but is actually blocked ... so waiting for this ;)

windagency avatar Nov 21 '20 14:11 windagency