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

Can we combine <script> tags from partials at the bottom of the rendered HTML (like in Rails does with yield tags #28

Open
QasimQureshi opened this issue Oct 9, 2017 · 2 comments

Comments

@QasimQureshi
Copy link

For HTML rendering speed, it's advisable to have <script> tags right at the bottom of the page (before </body>).

But when we have Marko partials, can we combine script tags to be yielded/rendered outside the partial's own block?

@DylanPiercey
Copy link
Contributor

I may be misunderstanding your question however it sounds like your issue is actually related to the build tooling (lasso or web pack). In lasso if you have bundlingEnabled: true all bundled javascript will be placed in a single script tag which you can append to the body.

Please let me know if I've misunderstood.

@DylanPiercey
Copy link
Contributor

DylanPiercey commented Apr 15, 2020

I think I understand what this issue is asking for now. We can't change the behavior of existing script tags, but we could add something like:

<append-script>
  console.log("hello");
</append-script>

Which would be added to the end of the body or flush. This would be a good edition to the tags repo and so I'll move the issue there.

@DylanPiercey DylanPiercey transferred this issue from marko-js/marko Apr 15, 2020
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

3 participants