Skip to content

Commit

Permalink
Docs: v17 features and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed May 7, 2024
1 parent 05fd53d commit 19c4b95
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 145 deletions.
14 changes: 14 additions & 0 deletions src/main/scala/com/raquo/laminar/api/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ trait Implicits extends Implicits.LowPriorityImplicits with CompositeValueMapper
// The various collection-to-modifier conversions below are cheaper and better equivalents of
// collection-to-inserter modifiers found in the `LowPriorityImplicits` trait below.
// We have a test that will fail should the priority of implicits be wrong.
// #Note ^^ That comment is outdated as of v17. We have a test that ensures that the selected
// implicits don't create unnecessary subscriptions, but the implicits in LowPriorityImplicits
// don't do that anymore, so the test does not catch using them. But, that is also not a problem.
// #TODO[Elegance] We should simplify the implicits even further
// - I think `nodeOptionToModifier` and `nodeSeqToModifier` are not needed anymore
// - Possibly other non-Component versions of the things in LowPriorityImplicits as well
// - But then we should probably move that Component stuff out of LowPriorityImplicits,
// I hope we don't get any conflicts. I'll leave this for v18.

// -- Methods to convert collections of nodes to modifiers --

Expand Down Expand Up @@ -145,6 +153,12 @@ object Implicits {
* `onMountInsert`, but they are relatively expensive compared to simpler
* alternatives when a mere Modifier would suffice. And so, the conversions
* below are de-prioritized.
*
* #Note: Prior to v17, these conversions involved dynamic inserters with
* inefficient implementations like `children <-- Val(nodes.toList)`.
* Now, they use static inserters, and don't have such a significant
* inefficiency.
* #TODO Simplify this! See the other #TODO comment above about moving stuff out of LowPriorityImplicits.
*/
trait LowPriorityImplicits {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ object ChildrenReceiver {
new LockedChildrenReceiver(nodes)
}

// #TODO[UX] Can I remove this method, to improve error messages, get rid of "none of the overloaded alternatives" error?
def <--(
childrenSource: Source[Seq[ChildNode.Base]]
): DynamicInserter = {
Expand Down
Loading

0 comments on commit 19c4b95

Please sign in to comment.