Skip to content

Inject client scripts URLs from Hypernova response #10

@marconi1992

Description

@marconi1992

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" >

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions