question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

are fragments worth keeping?

See original GitHub issue

fragments is a feature thatā€™s ā€œneatā€ but i have personally never used or felt a need for.

since its implementation is non-trivial and must hook into internal functions it must be present in every build. this incurs perf overhead, code size and added complexity.

its benefits are but a few:

  • a shallower dom in a few cases
  • optimizing re-rendering of some adjacent subset of sibling nodes.
  • allowing components that do not define their own root/wrapper. this is technically possible anyways by passing through whateverā€™s needed to the child component via opts:
function Parent() {
  return function() {
    return el("section", [
      vw(Child, null, null, {wrap: "p.foo"});
    ]);
  }
}

function Child(vm, model, key, opts) {
  return function() {
    return el(opts.wrap, "Hello World!");
  }
}

need to bench the perf gains and code size reduction from removing fragments.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Mar 28, 2017

the only legal HTML I can emit (without restructuring the data into groups) involves putting every row into a tbody which is unnecessary bloat and semantically incorrect.

i would actually argue that semantically it is correct, with every record being a tbody.

there is a way to make the html both, legal and semantic. if each row does in fact represent a record or single entity, then a table is just one of many presentational rendering options. rather than using a table you can use .records and .record with css display: table and display: table-row. you can do this using divs that have their css set to the appropriate presentational layout. by using divs, you now can have legal html by having both be adjacent without violating any html rules.

iā€™ve done the same in the past, and it works well when you need to collapse your ā€œtableā€ into a vertical non-table for mobile presentation within media queries. each table/tbody/tr/td has a specific css display type you can assign to arbitrary elements.

0reactions
leeoniyacommented, Mar 27, 2017

i guess the validators are too simplistic šŸ˜’

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are fragments worth it for casual players? : r/destiny2
Yes. They completely change the way you'll play the class and are a little easier to farm if you load up a legend...
Read more >
Is it worth it going for the optional fragments? - GameFAQs
It's not worth it really. But the fragments give you alot of cp and most are really easy or fun or have scenes....
Read more >
All Fragments and best ones to use - Destiny 2
Keep track of all the Fragments in Destiny 2 and which ones you should be using. Fragments are a new type of ability...
Read more >
FRAGMENTS FOR SELL! Should You BUY THEM ... - YouTube
FRAGMENTS FOR SELL! Should You BUY THEM? Our Opinion Ft. Chofly Elite FIND HIM HERE: https://www.youtube.com/c/ChoflyEliteDownload RAIDĀ ...
Read more >
Destiny 2: Every Solar Fragment, Ranked From Worst To Best
Solar Fragments are incredibly powerful and offer some of the strongest buffs we've seen in this subclass 3.0 system thus far. Constant damageĀ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found