Skip to content

v0.80.0 : @expose is coming (but broken currently)

Compare
Choose a tag to compare
@manatlan manatlan released this 25 Jan 17:08
· 178 commits to main since this release

2 new features :

  • the Tag.STRICT_MODE, when True : will raise an HtagException when dynamics tags (which use own def render(self):) change its first childs (it's a parano behaviour, to avoid creating tags which renders themselves at each interactions) (TODO: need doc)
  • @htag.expose (BROCKEN : will be fixed soon): will auto declare js-callback on python method (whose are decorated) (TODO: need doc)

Great simplification to do things like that (call from js side)

    from htag import Tag, expose

    class App(Tag.body):
        def init(self):
            self <= Tag.button("hello",_onclick="self.action(42)" )
        @expose
        def action(self,val):
            assert val == 42

BTW : this example ^^ is dumb, it has no interest IRL (prefer to call python directly with a self.bind, for example)

Full Changelog: v0.72.0...v0.80.0