Comments (4)
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.
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.
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.
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)
- Failed to load module
- Issue with for iterator
- @:uiComp metadata behavior HOT 7
- @:uiInitFunction only works for child classes
- HL bytecode hot reload and DomKit HOT 2
- Domkit License unclear HOT 3
- Adding Bitmap to domkit component, bitmap.dom is null HOT 2
- Transitions HOT 1
- Missing super component registration flow HOT 2
- Array alloc in applyStyle HOT 3
- Multiple CSS files, how to handle HOT 1
- :odd and :even not being refreshed HOT 3
- Uncaught TypeError (JavaScript target) HOT 1
- d9ef202 breaks compilation with the latest released version of haxe HOT 3
- Default component type resolution HOT 4
- Domkit sample in Heaps + example in docs doesn't compile HOT 4
- domkit css parsing support broken in javascript HOT 3
- A simple component causes: "domkit.Identifier should be String" HOT 1
- Incorrect CSS Id selector for component arrays
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domkit.