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

Scripts common.[hash].js and PageName.[hash].js are rendered synchronously #952

Open
sofiia-hlyniana opened this issue Sep 14, 2017 · 1 comment

Comments

@sofiia-hlyniana
Copy link

JS bundles neither have async attribute nor load asynchronously using LABjs.
I've tested my App with Google Audit and it definitely shows that these bundle scripts are blocking render, so the page can't be rendered until the browser loads them.
1

@gigabo
Copy link
Contributor

gigabo commented Sep 14, 2017

Hi @sofiia-hlyniana sorry you're running into trouble.

This is a surprising finding to me. One solution you might try is the jsBelowTheFold option, which may be set on the return value from handleRoute.

class Page {
    handleRoute() {
        return {code: 200, jsBelowTheFold: true};
    }
}

Beyond that if you'd like the requests to be started above the fold you could look into adding support for an async attribute on the script tags produced our copy of LABjs.

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

No branches or pull requests

2 participants