markknol / coconut.bootstrap

Bootstrap for Haxe/Coconut.ui
https://haxe.stroep.nl/coconut-bootstrap/
18 stars 2 forks source link

Make it work with coconut.html. #3

Open back2dos opened 4 years ago

back2dos commented 4 years ago

First stab at rendering all views statically. Let's track all issues in this PR.

markknol commented 4 years ago

I tried to change target:

interp

compile error: Field index for items not found on prototype bootstrap.ListGroup

PHP

runtime error:

Fatal error: Uncaught ErrorException: Undefined property: bootstrap\ListGroup::$items in c:\xyz\coconut.bootstrap\out\lib\bootstrap\ListGroup.php:198 Stack trace: #0 
c:\xyz\coconut.bootstrap\out\lib\bootstrap\ListGroup.php(198): php\Boot::php\{closure}(8, 'Undefined prope...', 'C:\\xyz\\...', 198, Array) #1 
[internal function]: bootstrap\ListGroup->render() #2 
c:\xyz\coconut.bootstrap\out\lib\php\_Boot\HxClosure.php(67): call_user_func_array(Array, Array) #3 
c:\xyz\coconut.bootstrap\out\lib\coconut\html\View.php(151): php\_Boot\HxClosure->__invoke() #4 
c:\xyz\coconut.bootstrap\out\lib\php\_Boot\HxAnon.php(44): coconut\html\View->coconut\html\{closure}() #5 
c:\xyz\coconut.bootstrap\out\lib\tink\state\_Observable\AutoObservable.php(103): php\_Boot\HxAnon->__call('f', Array) #6 
c:\xyz\coconut.bootstrap\out\lib\tink\state\_Observabl in 
c:\xyz\coconut.bootstrap\out\lib\bootstrap\ListGroup.php on line 198

HashLink 1.11

Works!

back2dos commented 4 years ago

Soo, the error was this: https://github.com/HaxeFoundation/haxe/issues/9379

I've made the three render functions in ListGroup optional.

As a side note: if you give a body to an @:attribute function, it can never be null (which is kind of the point).

markknol commented 4 years ago

Good to know!