Giter Site home page Giter Site logo

[Regression] Text node issue about domkit HOT 4 CLOSED

heapsio avatar heapsio commented on August 15, 2024
[Regression] Text node issue

from domkit.

Comments (4)

ncannasse avatar ncannasse commented on August 15, 2024 1

This is intended, as we support <somediv>for( x in arr ) <a/></somediv> and have plans to support more code constructs at this toplevel (var and if for example).
Also, usually inline texts should be usually localized, requiring some macros.
You can still use domkit macros for that, for instance @text("Some Text") that will generate your custom component

from domkit.

kLabz avatar kLabz commented on August 15, 2024 1

Does it really have to be top-level? Adding such restrictions on plain text for a UI description "language" seems harsh to me (even though I agree that text should usually be localized, but don't think localization should be enforced like that).

With tink_hxx we have control structures as "pseudo-tags", which does not compete with plain text (but would shadow components named for, switch, case, if, else, .. which should be mostly fine?).

Another way of supporting both code and plain text would be to have code blocks inside { ... } (or ${ ... }), making it closer to code in haxe string interpolation.

from domkit.

rcstuber avatar rcstuber commented on August 15, 2024

Ok, I understand your plans going forward. But the intention should at least be announced/documented somehow in the commit message, as it's really a breaking change and the documentation (https://heaps.io/documentation/domkit.html) updated in that regard. I know how much we all love doing that ;-)

from domkit.

kLabz avatar kLabz commented on August 15, 2024

Another way of supporting both code and plain text would be to have code blocks inside { ... } (or ${ ... }), making it closer to code in haxe string interpolation.

Just re-read the docs and this is actually already working like that, and documented:

<flow>
${ for( t in tiles ) <bitmap src={t} id="btns[]"/> }
</flow>

Is it really worth it to break plain text (with bad error handling) just to be able to do the same thing (well less, new syntax only supports for atm) without ${}?

from domkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.