Comments (9)
👍
from compiler.
@GianlucaGuarini , yes, it is already fixed my local copy, but now having problems with compiler logic.
Please tell if I'm wrong...
The file test/tag/named-child.tag
(one of various errors) is:
<named-child-parent>
<named-child name="tags-child"></named-child>
</named-child-parent>
<named-child>I have a name</named-child>
now, the compiler is generating:
riot.tag2('named-child-parent', '<named-child name="tags-child"></named-child>', '', '', function(opts) {
});
riot.tag2('named-child', '', '', '', function(opts) {
I have a name // <================ Parse error here when executing riot.tag2
});
I think this is the intention:
<named-child-parent>
<named-child name="tags-child"></named-child>
</named-child-parent>
<named-child><p>I have a name</p></named-child>
The compiler is generating, I think correctly:
riot.tag2('named-child-parent', '<named-child name="tags-child"></named-child>', '', '', function(opts) {
});
riot.tag2('named-child', '<p>I have a name</p>', '', '', function(opts) {
});
In the first form, named-child is a custom tag with no html content inside, only bad javascript. I'm wrong? If so, how to detect the difference. I'm reading the old code right now to understand this.
EDIT: This is from specs/node.js test
from compiler.
@aMarCruz you can indent that tag, I have already updated the analyzer to detect this kind of issue https://github.com/riot/cli/blob/master/test/tags/analyzer/one-line.tag
from compiler.
You mean indenting <named-child>
? i.e. the rule of 0 indentation for custom tags? the compiler is recognizing indented tags now, but is ok back to 0, it is simpler.
btw: call to riot.tag2
by the compiler was done mainly for precompiled expressions, this is transparent to users and sets brackets automatically, but may complicate the tests. I must mantain this, or back to riot.tag? Isee riot.tag2 in your tests, maybe is late to quest.
Now I think the way for precompiled expressions is a postprocessor, separated from riot, to not complicate the current code.
from compiler.
You mean indenting
<named-child>
?
yes
btw: call to riot.tag2 by the compiler was done mainly for precompiled expressions, this is transparent to users and sets brackets automatically, but may complicate the tests. I must mantain this, or back to riot.tag? Isee riot.tag2 in your tests, maybe is late to quest.
No it's never too late ;) just try to freeze the compiler api in order to make a new riot release
I think the compiler should mainly output riot compliant code, and riot-cli
just prints the output in a file. Honestly I didn't really get why you needed riot.tag2
but if it's needed for the new compiler that's ok for me
from compiler.
riot.tag2
was for differentiate compiler code from users code, in precompiled expressions. It is not necessary now, except for auto-setting brackets, but it can do on riot.tag, or remove the feature, your decision.
Working in adjust the indent 0 regretion.
from compiler.
You can either keep riot.tag2
but we need to update the doc, or remove it handling it in runtime. I am fine with both solutions
from compiler.
Well, keep riot2
please, the distinction can be useful in the future.
The working on the fixes for browser is at ~80%, I'm out of home this weekend, upon returning I will finish the code, and begin the docs.
from compiler.
@aMarCruz thank you I will try to fix the ie issue in our unit test
from compiler.
Related Issues (20)
- [BUG]the compile(4.0.0-beta.5) should handle empty style or script node
- when tag with a namespace is defined, inline styling is not working HOT 2
- Unwanted characters are inserted when escaping CSS strings HOT 4
- Behaviour of value attribute HOT 17
- v4.3.6 Didn't get published on npm repository HOT 2
- createValueExpression::sourceNode.expressions is undefined
- Cannot access object property within template, key is not defined HOT 1
- Value on custom tags should be always passed down as prop
- Parse error when use stylus as css preprocessor HOT 2
- After version 4.4.3 (v4.5.0) an error occurs: string.trimStart is not a function HOT 3
- Emit compiler warning, if riot script tag is outside of root tag HOT 1
- ImportExpressions are not supported
- Asynchronous preprocessor HOT 4
- Wrong compilation for in parentheses expression HOT 2
- "src" attribute for <style> and <script> HOT 5
- Multiline Sourcemap Issues HOT 2
- Importing scss inside of riot component HOT 4
- template element related: generated style has incorrect selector; elements of template does not receive is= tagname to be selected HOT 2
- Inline object declarations in tags fail to compile in RiotJS ver 6; works in RiotJS ver 5. HOT 2
- Boolean attributes rendering should be enabled on custom elements as well only for certain attributes
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 compiler.