kweb-core icon indicating copy to clipboard operation
kweb-core copied to clipboard

To externalize JS code to separated JS file

Open smallufo opened this issue 5 years ago • 3 comments

To externalize JS code to separated JS file , instead of put it in the

smallufo avatar Apr 26 '20 17:04 smallufo

Are you referring to the generated JavaScript?

That would definitely be neater than embedding it in <script> tags, but I'm concerned that it would slow down initial page render due to the additional HTTP get request.

sanity avatar Apr 26 '20 21:04 sanity

Yes , I meant the generated JS. I just run some demo and saw the source containing these JS in the header . I think it is not good for pagespeed . Modern approaches may externalize these JS codes to a js file (and adding some md5 signature to the filename) . And it may be cached too .

smallufo avatar Apr 27 '20 02:04 smallufo

It wouldn't be too difficult to implement - and it would be tidier, but I'm not convinced it would reduce page-render time. It would be worth experimenting with though.

sanity avatar Apr 28 '20 23:04 sanity

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 12 '22 03:10 github-actions[bot]

I think this is still relevant.

Related: #332

sanity avatar Oct 12 '22 16:10 sanity

Thinking about it, I'm not sure this would be advantageous.

sanity avatar Oct 18 '22 14:10 sanity