Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject client scripts URLs from Hypernova response #10

Open
marconi1992 opened this issue Apr 28, 2020 · 1 comment · May be fixed by #11
Open

Inject client scripts URLs from Hypernova response #10

marconi1992 opened this issue Apr 28, 2020 · 1 comment · May be fixed by #11
Labels
enhancement New feature or request

Comments

@marconi1992
Copy link
Member

marconi1992 commented Apr 28, 2020

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 marconi1992 added the enhancement New feature or request label Apr 28, 2020
@windagency
Copy link

windagency commented Nov 21, 2020

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants