Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Consider moving script tag to end of <body> #3

Open
buesing opened this issue Mar 9, 2017 · 3 comments
Open

Consider moving script tag to end of <body> #3

buesing opened this issue Mar 9, 2017 · 3 comments

Comments

@buesing
Copy link

buesing commented Mar 9, 2017

In order not to have to wait for the document ready event to execute JS on the DOM

@tom2strobl
Copy link
Contributor

This is necessary for the SPA renderer to operate correctly. So I would say that if preRender is false it should move scripts to the bottom, otherwise leave it at the top.

@buesing
Copy link
Author

buesing commented Mar 22, 2017

Maybe it's a possibility to just change the initial render in the app.js to

document.addEventListener('DOMContentLoaded', () => {
   render();
});

because right now the default app throws an error when built because the DOM is not there yet

@tom2strobl
Copy link
Contributor

Its in the body again per default in the last patch, though the change probably broke SPA rendering. I'll investigate when time allows it

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

No branches or pull requests

2 participants