Skip to content

Commit 48f52da

Browse files
committed
New: [WIP] Re-compile everything in SDT for compile-time code generation. Fixes #87.
This commit parses existing SDT traits into the new structures, and clean up scaladocs, and adds a bunch more documentation links.
1 parent 86d7aae commit 48f52da

File tree

178 files changed

+18129
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+18129
-552
lines changed

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ lazy val root = project.in(file("."))
6262

6363
lazy val domtypes = crossProject(JSPlatform, JVMPlatform).in(file("."))
6464
.settings(commonSettings)
65+
.settings(
66+
libraryDependencies ++= Seq(
67+
"org.scalatest" %%% "scalatest" % Versions.ScalaTest % Test
68+
)
69+
)
6570
.settings(
6671
scalacOptions ~= (_.filterNot(Set(
6772
"-Wunused:params",

js/src/main/scala/com/raquo/domtypes/jsdom/defs/package.scala

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package com.raquo.domtypes.jsdom
22

3-
import com.raquo.domtypes.generic
3+
import com.raquo.domtypes.old
44
import com.raquo.domtypes.jsdom.defs.events._
55
import org.scalajs.dom
66

77
package object defs {
88

99
object eventProps {
1010

11-
type ClipboardEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.ClipboardEventProps[EP, dom.Event, dom.ClipboardEvent]
11+
type ClipboardEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.ClipboardEventProps[EP, dom.Event, dom.ClipboardEvent]
1212

13-
type ErrorEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.ErrorEventProps[EP, dom.Event, dom.ErrorEvent]
13+
type ErrorEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.ErrorEventProps[EP, dom.Event, dom.ErrorEvent]
1414

15-
type FormEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.FormEventProps[
15+
type FormEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.FormEventProps[
1616
EP,
1717
dom.Event,
1818
TypedTargetFocusEvent[dom.Element],
@@ -23,19 +23,19 @@ package object defs {
2323
TypedTargetEvent[dom.html.Input]
2424
]
2525

26-
type KeyboardEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.KeyboardEventProps[EP, dom.Event, dom.KeyboardEvent]
26+
type KeyboardEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.KeyboardEventProps[EP, dom.Event, dom.KeyboardEvent]
2727

28-
type MediaEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.MediaEventProps[EP, dom.Event]
28+
type MediaEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.MediaEventProps[EP, dom.Event]
2929

30-
type MiscellaneousEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.MiscellaneousEventProps[
30+
type MiscellaneousEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.MiscellaneousEventProps[
3131
EP,
3232
dom.Event,
3333
dom.AnimationEvent,
3434
dom.TransitionEvent,
3535
dom.UIEvent
3636
]
3737

38-
type MouseEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.MouseEventProps[
38+
type MouseEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.MouseEventProps[
3939
EP,
4040
dom.Event,
4141
dom.MouseEvent,
@@ -44,14 +44,14 @@ package object defs {
4444
dom.WheelEvent
4545
]
4646

47-
type PointerEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.PointerEventProps[
47+
type PointerEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.PointerEventProps[
4848
EP,
4949
dom.Event,
5050
dom.PointerEvent,
5151
TypedTargetPointerEvent[dom.Element]
5252
]
5353

54-
type WindowOnlyEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.WindowOnlyEventProps[
54+
type WindowOnlyEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.WindowOnlyEventProps[
5555
EP,
5656
dom.Event,
5757
dom.UIEvent,
@@ -63,7 +63,7 @@ package object defs {
6363
dom.StorageEvent
6464
]
6565

66-
type DocumentOnlyEventProps[EP[_ <: dom.Event]] = generic.defs.eventProps.DocumentOnlyEventProps[
66+
type DocumentOnlyEventProps[EP[_ <: dom.Event]] = old.defs.eventProps.DocumentOnlyEventProps[
6767
EP,
6868
dom.Event
6969
]
@@ -78,46 +78,46 @@ package object defs {
7878
with MediaEventProps[EP]
7979
with MiscellaneousEventProps[EP]
8080
with MouseEventProps[EP]
81-
with PointerEventProps[EP] { this: generic.builders.EventPropBuilder[EP, dom.Event] => }
81+
with PointerEventProps[EP] { this: old.builders.EventPropBuilder[EP, dom.Event] => }
8282

8383
/** Matches WindowEventHandlers: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers */
8484
trait WindowEventProps[EP[_ <: dom.Event]]
8585
extends GlobalEventProps[EP]
86-
with WindowOnlyEventProps[EP] { this: generic.builders.EventPropBuilder[EP, dom.Event] => }
86+
with WindowOnlyEventProps[EP] { this: old.builders.EventPropBuilder[EP, dom.Event] => }
8787

8888
trait DocumentEventProps[EP[_ <: dom.Event]]
8989
extends GlobalEventProps[EP]
9090
with DocumentOnlyEventProps[EP]
91-
with ClipboardEventProps[EP] { this: generic.builders.EventPropBuilder[EP, dom.Event] => }
91+
with ClipboardEventProps[EP] { this: old.builders.EventPropBuilder[EP, dom.Event] => }
9292

9393
trait ElementEventProps[EP[_ <: dom.Event]]
94-
extends GlobalEventProps[EP] { this: generic.builders.EventPropBuilder[EP, dom.Event] => }
94+
extends GlobalEventProps[EP] { this: old.builders.EventPropBuilder[EP, dom.Event] => }
9595

9696
trait HTMLElementEventProps[EP[_ <: dom.Event]]
9797
extends ElementEventProps[EP]
98-
with ClipboardEventProps[EP] { this: generic.builders.EventPropBuilder[EP, dom.Event] => }
98+
with ClipboardEventProps[EP] { this: old.builders.EventPropBuilder[EP, dom.Event] => }
9999

100100
}
101101

102102
object tags {
103103

104-
type DocumentTags[T[_ <: dom.html.Element]] = generic.defs.tags.DocumentTags[T, dom.html.Element, dom.html.Html, dom.html.Head, dom.html.Base, dom.html.Link, dom.html.Meta, dom.html.Script, dom.html.Element]
104+
type DocumentTags[T[_ <: dom.html.Element]] = old.defs.tags.DocumentTags[T, dom.html.Element, dom.html.Html, dom.html.Head, dom.html.Base, dom.html.Link, dom.html.Meta, dom.html.Script, dom.html.Element]
105105

106-
type GroupingTags[T[_ <: dom.html.Element]] = generic.defs.tags.GroupingTags[T, dom.html.Element, dom.html.Paragraph, dom.html.HR, dom.html.Pre, dom.html.Quote, dom.html.OList, dom.html.UList, dom.html.LI, dom.html.DList, dom.html.Element, dom.html.Div]
106+
type GroupingTags[T[_ <: dom.html.Element]] = old.defs.tags.GroupingTags[T, dom.html.Element, dom.html.Paragraph, dom.html.HR, dom.html.Pre, dom.html.Quote, dom.html.OList, dom.html.UList, dom.html.LI, dom.html.DList, dom.html.Element, dom.html.Div]
107107

108-
type TextTags[T[_ <: dom.html.Element]] = generic.defs.tags.TextTags[T, dom.html.Element, dom.html.Anchor, dom.html.Element, dom.html.Span, dom.html.BR, dom.html.Mod]
108+
type TextTags[T[_ <: dom.html.Element]] = old.defs.tags.TextTags[T, dom.html.Element, dom.html.Anchor, dom.html.Element, dom.html.Span, dom.html.BR, dom.html.Mod]
109109

110-
type FormTags[T[_ <: dom.html.Element]] = generic.defs.tags.FormTags[T, dom.html.Element, dom.html.Form, dom.html.FieldSet, dom.html.Legend, dom.html.Label, dom.html.Input, dom.html.Button, dom.html.Select, dom.html.DataList, dom.html.OptGroup, dom.html.Option, dom.html.TextArea]
110+
type FormTags[T[_ <: dom.html.Element]] = old.defs.tags.FormTags[T, dom.html.Element, dom.html.Form, dom.html.FieldSet, dom.html.Legend, dom.html.Label, dom.html.Input, dom.html.Button, dom.html.Select, dom.html.DataList, dom.html.OptGroup, dom.html.Option, dom.html.TextArea]
111111

112-
type SectionTags[T[_ <: dom.html.Element]] = generic.defs.tags.SectionTags[T, dom.html.Element, dom.html.Body, dom.html.Element, dom.html.Heading]
112+
type SectionTags[T[_ <: dom.html.Element]] = old.defs.tags.SectionTags[T, dom.html.Element, dom.html.Body, dom.html.Element, dom.html.Heading]
113113

114-
type EmbedTags[T[_ <: dom.html.Element]] = generic.defs.tags.EmbedTags[T, dom.html.Element, dom.html.Image, dom.html.IFrame, dom.html.Embed, dom.html.Object, dom.html.Param, dom.html.Video, dom.html.Audio, dom.html.Source, dom.html.Track, dom.html.Canvas, dom.html.Map, dom.html.Area]
114+
type EmbedTags[T[_ <: dom.html.Element]] = old.defs.tags.EmbedTags[T, dom.html.Element, dom.html.Image, dom.html.IFrame, dom.html.Embed, dom.html.Object, dom.html.Param, dom.html.Video, dom.html.Audio, dom.html.Source, dom.html.Track, dom.html.Canvas, dom.html.Map, dom.html.Area]
115115

116-
type TableTags[T[_ <: dom.html.Element]] = generic.defs.tags.TableTags[T, dom.html.Element, dom.html.Table, dom.html.TableCaption, dom.html.TableCol, dom.html.TableSection, dom.html.TableRow, dom.html.TableCell]
116+
type TableTags[T[_ <: dom.html.Element]] = old.defs.tags.TableTags[T, dom.html.Element, dom.html.Table, dom.html.TableCaption, dom.html.TableCol, dom.html.TableSection, dom.html.TableRow, dom.html.TableCell]
117117

118-
type MiscTags[T[_ <: dom.html.Element]] = generic.defs.tags.MiscTags[T, dom.html.Element, dom.html.Title, dom.html.Style, dom.html.Element, dom.html.Quote, dom.html.Progress, dom.html.Menu]
118+
type MiscTags[T[_ <: dom.html.Element]] = old.defs.tags.MiscTags[T, dom.html.Element, dom.html.Title, dom.html.Style, dom.html.Element, dom.html.Quote, dom.html.Progress, dom.html.Menu]
119119

120-
type SvgTags[T[_ <: dom.svg.Element]] = generic.defs.tags.SvgTags[
120+
type SvgTags[T[_ <: dom.svg.Element]] = old.defs.tags.SvgTags[
121121
T,
122122
dom.svg.Element,
123123
dom.svg.A,

js/src/test/scala/com/raquo/domtypes/CompileTest.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import com.raquo.domtypes.fixtures.complexKeys._
66
import com.raquo.domtypes.fixtures.keys._
77
import com.raquo.domtypes.fixtures.styles._
88
import com.raquo.domtypes.fixtures.tags._
9-
import com.raquo.domtypes.generic.builders.{HtmlTagBuilder, SvgTagBuilder}
10-
import com.raquo.domtypes.generic.defs.attrs.{AriaAttrs, HtmlAttrs, SvgAttrs}
11-
import com.raquo.domtypes.generic.defs.props.Props
12-
import com.raquo.domtypes.generic.defs.reflectedAttrs.ReflectedHtmlAttrs
13-
import com.raquo.domtypes.generic.defs.styles.Styles
149
import com.raquo.domtypes.jsdom.defs.eventProps.{ClipboardEventProps, DocumentOnlyEventProps, ErrorEventProps, FormEventProps, HTMLElementEventProps, KeyboardEventProps, MediaEventProps, MiscellaneousEventProps, MouseEventProps, PointerEventProps, WindowOnlyEventProps}
1510
import com.raquo.domtypes.jsdom.defs.tags.{DocumentTags, EmbedTags, FormTags, GroupingTags, MiscTags, SectionTags, SvgTags, TableTags, TextTags}
11+
import com.raquo.domtypes.old.builders.{HtmlTagBuilder, SvgTagBuilder}
12+
import com.raquo.domtypes.old.defs.attrs.{AriaAttrs, HtmlAttrs, SvgAttrs}
13+
import com.raquo.domtypes.old.defs.props.Props
14+
import com.raquo.domtypes.old.defs.reflectedAttrs.ReflectedHtmlAttrs
15+
import com.raquo.domtypes.old.defs.styles.Styles
1616
import org.scalajs.dom
1717

1818
/** We just want to make sure that this compiles. */

jvm/src/main/scala/com/raquo/domtypes/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)