svelte icon indicating copy to clipboard operation
svelte copied to clipboard

fix #3586 comments instead of empty text nodes (perf)

Open neuronetio opened this issue 5 years ago • 4 comments

Comment nodes are much faster - no styles, drawing etc...

fix #3586

Before submitting the PR, please make sure you do the following

  • [x] It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • [x] This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • [x] Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • [x] Run the tests tests with npm test or yarn test)

neuronetio avatar Oct 01 '19 01:10 neuronetio

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 26 '21 20:06 stale[bot]

I think this is a good idea. The vast majority of the comments on the linked issue support this change. The only possible hesitation was that text nodes are less cluttered when you open devtools - though I somewhat think the clutter is a good thin as it makes it clear what Svelte it doing and provides impetus for making it stop creating lots of empty text nodes. In the meantime, this is better performance

benmccann avatar Jul 23 '21 17:07 benmccann

I think using comment nodes would spam the browser elements view quite a bit. I feel like we should investigate using fewer of those empty text nodes instead.

dummdidumm avatar Mar 14 '23 15:03 dummdidumm

I would love to see this change land as part of a dev vs prod style flagging system where the output in prod mode is allowed to be a bit uglier for the sake of speed/size/etc.

tivac avatar Mar 15 '23 04:03 tivac