diff --git a/.haxerc b/.haxerc index ce83921..ef43126 100644 --- a/.haxerc +++ b/.haxerc @@ -1,4 +1,4 @@ { - "version": "dc1fbac", + "version": "4.3.6", "resolveLibs": "scoped" } \ No newline at end of file diff --git a/dev.hxml b/dev.hxml index 1c066ab..6993889 100644 --- a/dev.hxml +++ b/dev.hxml @@ -2,4 +2,5 @@ tests.hxml -lib coconut.vdom -lib travix -js bin/js/tests.js --dce full \ No newline at end of file +-dce full +-D no-deprecation-warnings \ No newline at end of file diff --git a/haxe_libraries/coconut.data.hxml b/haxe_libraries/coconut.data.hxml index 4cd16f2..27a45cb 100644 --- a/haxe_libraries/coconut.data.hxml +++ b/haxe_libraries/coconut.data.hxml @@ -1,8 +1,7 @@ -# @install: lix --silent download "gh://github.com/MVCoconut/coconut.data#587d2c2dbc57cc24ecb52303c5e22eb97fed12cd" into coconut.data/0.12.1/github/587d2c2dbc57cc24ecb52303c5e22eb97fed12cd +# @install: lix --silent download "gh://github.com/MVCoconut/coconut.data#ca17dc7efb408b8032116493fb2e02f362382956" into coconut.data/0.12.1/github/ca17dc7efb408b8032116493fb2e02f362382956 -lib tink_anon -lib tink_priority -lib tink_pure -lib tink_state --cp ${HAXE_LIBCACHE}/coconut.data/0.12.1/github/587d2c2dbc57cc24ecb52303c5e22eb97fed12cd/src --D coconut.data=0.12.1 ---macro coconut.data.macros.Setup.run() \ No newline at end of file +-cp ${HAXE_LIBCACHE}/coconut.data/0.12.1/github/ca17dc7efb408b8032116493fb2e02f362382956/src +-D coconut.data=0.12.1 \ No newline at end of file diff --git a/haxe_libraries/coconut.diffing.hxml b/haxe_libraries/coconut.diffing.hxml index 7abf189..de58808 100644 --- a/haxe_libraries/coconut.diffing.hxml +++ b/haxe_libraries/coconut.diffing.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/MVCoconut/coconut.diffing#043d085a3a16bfd6e44d934424a0c403d14a9578" into coconut.diffing/0.3.0/github/043d085a3a16bfd6e44d934424a0c403d14a9578 +# @install: lix --silent download "gh://github.com/MVCoconut/coconut.diffing#499d62647c2ff68ad1336a311005f9f9d8cdf332" into coconut.diffing/0.5.0/github/499d62647c2ff68ad1336a311005f9f9d8cdf332 -lib coconut.ui --cp ${HAXE_LIBCACHE}/coconut.diffing/0.3.0/github/043d085a3a16bfd6e44d934424a0c403d14a9578/src --D coconut.diffing=0.3.0 \ No newline at end of file +-cp ${HAXE_LIBCACHE}/coconut.diffing/0.5.0/github/499d62647c2ff68ad1336a311005f9f9d8cdf332/src +-D coconut.diffing=0.5.0 \ No newline at end of file diff --git a/haxe_libraries/coconut.ui.hxml b/haxe_libraries/coconut.ui.hxml index d79faff..ff2a19f 100644 --- a/haxe_libraries/coconut.ui.hxml +++ b/haxe_libraries/coconut.ui.hxml @@ -1,6 +1,6 @@ -# @install: lix --silent download "gh://github.com/MVCoconut/coconut.ui#0a37e3d706e1773e6623c8d425f16d0b9c96bedd" into coconut.ui/0.12.0/github/0a37e3d706e1773e6623c8d425f16d0b9c96bedd +# @install: lix --silent download "gh://github.com/MVCoconut/coconut.ui#08d710a4a62cc2fa744d16d8ff6b4cf7a08de230" into coconut.ui/0.12.0/github/08d710a4a62cc2fa744d16d8ff6b4cf7a08de230 -lib coconut.data -lib tink_anon -lib tink_hxx --cp ${HAXE_LIBCACHE}/coconut.ui/0.12.0/github/0a37e3d706e1773e6623c8d425f16d0b9c96bedd/src +-cp ${HAXE_LIBCACHE}/coconut.ui/0.12.0/github/08d710a4a62cc2fa744d16d8ff6b4cf7a08de230/src -D coconut.ui=0.12.0 \ No newline at end of file diff --git a/haxe_libraries/html-entities.hxml b/haxe_libraries/html-entities.hxml index b5a42cd..b1633ab 100644 --- a/haxe_libraries/html-entities.hxml +++ b/haxe_libraries/html-entities.hxml @@ -1,3 +1,3 @@ +-D html-entities=1.0.0 # @install: lix --silent download "haxelib:/html-entities#1.0.0" into html-entities/1.0.0/haxelib -cp ${HAXE_LIBCACHE}/html-entities/1.0.0/haxelib/src --D html-entities=1.0.0 \ No newline at end of file diff --git a/haxe_libraries/tink_anon.hxml b/haxe_libraries/tink_anon.hxml index e83a832..6046e27 100644 --- a/haxe_libraries/tink_anon.hxml +++ b/haxe_libraries/tink_anon.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/haxetink/tink_anon#3cceb2a4bd00bd5b9a4476cb889a37f1e178e805" into tink_anon/0.7.0/github/3cceb2a4bd00bd5b9a4476cb889a37f1e178e805 +# @install: lix --silent download "gh://github.com/haxetink/tink_anon#0277e6e3f97a7878f1aa9aeeccc4b7be0e9c82bc" into tink_anon/0.7.0/github/0277e6e3f97a7878f1aa9aeeccc4b7be0e9c82bc -lib tink_macro --cp ${HAXE_LIBCACHE}/tink_anon/0.7.0/github/3cceb2a4bd00bd5b9a4476cb889a37f1e178e805/src +-cp ${HAXE_LIBCACHE}/tink_anon/0.7.0/github/0277e6e3f97a7878f1aa9aeeccc4b7be0e9c82bc/src -D tink_anon=0.7.0 \ No newline at end of file diff --git a/haxe_libraries/tink_core.hxml b/haxe_libraries/tink_core.hxml index 4df2f69..2673982 100644 --- a/haxe_libraries/tink_core.hxml +++ b/haxe_libraries/tink_core.hxml @@ -1,3 +1,3 @@ -# @install: lix --silent download "gh://github.com/haxetink/tink_core#4be6eca2d0b6dc9f0d8749ba84b4d7a465f049b0" into tink_core/2.0.2/github/4be6eca2d0b6dc9f0d8749ba84b4d7a465f049b0 --cp ${HAXE_LIBCACHE}/tink_core/2.0.2/github/4be6eca2d0b6dc9f0d8749ba84b4d7a465f049b0/src --D tink_core=2.0.2 \ No newline at end of file +# @install: lix --silent download "gh://github.com/haxetink/tink_core#323f80d2ae63036e5b324dc68775f79e98bde396" into tink_core/2.1.1/github/323f80d2ae63036e5b324dc68775f79e98bde396 +-cp ${HAXE_LIBCACHE}/tink_core/2.1.1/github/323f80d2ae63036e5b324dc68775f79e98bde396/src +-D tink_core=2.1.1 \ No newline at end of file diff --git a/haxe_libraries/tink_hxx.hxml b/haxe_libraries/tink_hxx.hxml index 2739de7..97169f4 100644 --- a/haxe_libraries/tink_hxx.hxml +++ b/haxe_libraries/tink_hxx.hxml @@ -1,6 +1,6 @@ -# @install: lix --silent download "gh://github.com/haxetink/tink_hxx#0d6cda883d5ef4c1186dbad476e016b98aad68b8" into tink_hxx/0.25.0/github/0d6cda883d5ef4c1186dbad476e016b98aad68b8 +# @install: lix --silent download "gh://github.com/haxetink/tink_hxx#07cada55ff0b550b47f6e1ffb888be62d1e969c4" into tink_hxx/0.25.0/github/07cada55ff0b550b47f6e1ffb888be62d1e969c4 -lib html-entities -lib tink_anon -lib tink_parse --cp ${HAXE_LIBCACHE}/tink_hxx/0.25.0/github/0d6cda883d5ef4c1186dbad476e016b98aad68b8/src +-cp ${HAXE_LIBCACHE}/tink_hxx/0.25.0/github/07cada55ff0b550b47f6e1ffb888be62d1e969c4/src -D tink_hxx=0.25.0 \ No newline at end of file diff --git a/haxe_libraries/tink_macro.hxml b/haxe_libraries/tink_macro.hxml index 8bb9353..15ed73d 100644 --- a/haxe_libraries/tink_macro.hxml +++ b/haxe_libraries/tink_macro.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/haxetink/tink_macro#f1010a518fdefb484eaff8727ff022ba51658e53" into tink_macro/0.23.0/github/f1010a518fdefb484eaff8727ff022ba51658e53 +# @install: lix --silent download "gh://github.com/haxetink/tink_macro#40d7c2fbde362ed8273698626a31cfe35c001101" into tink_macro/0.23.0/github/40d7c2fbde362ed8273698626a31cfe35c001101 -lib tink_core --cp ${HAXE_LIBCACHE}/tink_macro/0.23.0/github/f1010a518fdefb484eaff8727ff022ba51658e53/src +-cp ${HAXE_LIBCACHE}/tink_macro/0.23.0/github/40d7c2fbde362ed8273698626a31cfe35c001101/src -D tink_macro=0.23.0 \ No newline at end of file diff --git a/haxe_libraries/tink_state.hxml b/haxe_libraries/tink_state.hxml index 58a8f3d..5a1702b 100644 --- a/haxe_libraries/tink_state.hxml +++ b/haxe_libraries/tink_state.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/haxetink/tink_state#b01eb8bd47f7264420604b5f8816dde69e5dec55" into tink_state/1.0.0-beta.3/github/b01eb8bd47f7264420604b5f8816dde69e5dec55 +# @install: lix --silent download "gh://github.com/haxetink/tink_state#9fda3b07ea27e299e7f53720d6e349787477268e" into tink_state/1.0.0-beta.3/github/9fda3b07ea27e299e7f53720d6e349787477268e -lib tink_core --cp ${HAXE_LIBCACHE}/tink_state/1.0.0-beta.3/github/b01eb8bd47f7264420604b5f8816dde69e5dec55/src +-cp ${HAXE_LIBCACHE}/tink_state/1.0.0-beta.3/github/9fda3b07ea27e299e7f53720d6e349787477268e/src -D tink_state=1.0.0-beta.3 \ No newline at end of file diff --git a/src/coconut/vdom/Html.hx b/src/coconut/vdom/Html.hx index de4e4aa..b833c1c 100644 --- a/src/coconut/vdom/Html.hx +++ b/src/coconut/vdom/Html.hx @@ -25,8 +25,8 @@ class Html { case v: v; } - static public inline function text(value:String):RenderResult - return Text.inst.vnode(value, null, null, null); + static public function text(value:String):RenderResult + return inline TextNode.inst.vnode(value, null, null, null);//TODO: would be faster to have a dedicated text node type insteat of going through factories and all that static public function raw(hxxMeta:HxxMeta, attr:HtmlFragmentAttr & { ?tag:String }):RenderResult { return HtmlFragment.byTag(attr.tag).vnode(attr, hxxMeta.key, hxxMeta.ref); @@ -78,20 +78,24 @@ private class HtmlFragment extends Factory { } -private class Text extends Factory { - static public var inst(default, null):Text = new Text(); +private class TextNode extends Factory { + static public var inst(default, null):TextNode = new TextNode(); function new() {} - override public function adopt(target:Node) + override public function adopt(target:Node):Text return - if (target.nodeType == Node.TEXT_NODE) target; + if (target.nodeType == Node.TEXT_NODE) cast target; else null; + override function hydrate(target:Text, data:String) + if (target.textContent.length > data.length) + target.splitText(data.length); + public function create(text) return document.createTextNode(text); - public function update(target:Node, nu, old) + public function update(target:Text, nu, old) if (nu != old) target.textContent = nu; } diff --git a/src/coconut/vdom/macros/HXX.hx b/src/coconut/vdom/macros/HXX.hx index f18c205..144f8c4 100644 --- a/src/coconut/vdom/macros/HXX.hx +++ b/src/coconut/vdom/macros/HXX.hx @@ -5,7 +5,7 @@ import coconut.ui.macros.Helpers; import tink.hxx.*; class HXX { - static final generator = new Generator(Tag.extractAllFrom(macro coconut.vdom.Html)); + static final generator = new Generator(); static public function parse(e) return Helpers.parse(e, generator, 'coconut.vdom.RenderResult.fragment'); diff --git a/tests/Issue37.hx b/tests/Issue37.hx index fca3080..9fdc760 100644 --- a/tests/Issue37.hx +++ b/tests/Issue37.hx @@ -13,7 +13,7 @@ class Issue37 { Renderer.mount(container, ' -