[Discuss] Maybe we can use react or jsx as DSL
See original GitHub issueIn my opinions, there is not many people use pugjs
. And maybe we can use react as second choose. We can write some logic code, like below
const mockData = [{ name: 'stephen', sex: 'male', age: 25 }, { name: 'stephen', sex: 'male', age: 25 }, { name: 'stephen', sex: 'male', age: 25 }, { name: 'stephen', sex: 'male', age: 25 }];
const Item = props => (
<div>
<p>name: {props.name}</p>
<p>sex: {props.male}</p>
<p>age: {props.age}</p>
</div>
);
const List = props => (
<div>
{ mockData.map((item, index) => <Item name={item.name} male={item.male} age={item.age} key={index} />) }
</div>
);
That is more powerful than just HTML, and can provide kinds of scenes to use.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Discussion on: 2021 JavaScript framework
But you have to basically do the same with any framework using JSX or any other DSL, regardless if it is fully compiled...
Read more >Replace the term attr by prop · Issue #2 · Zaid-Ajaj/Feliz - GitHub
The original React DSL, is based on JSX (and so HTML) syntax which is a layer on top of react. In JSX, we...
Read more >JSX In Depth - React
The first part of a JSX tag determines the type of the React element. Capitalized types indicate that the JSX tag is referring...
Read more >React's JSX Doesn't Violate Separation of Concerns
JSX isn't HTML. It's a DSL (domain specific language) over Javascript. It's Javascript all the way down. There's no HTML here, and React...
Read more >JSX is inefficient by default … but … | by Andrea Giammarchi
Please don't miss JSX can be more efficient by default post, which explain my journey to achieve awesome performance out of JSX! I've ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This sounds like a completely different project, with different objectives, a different stack, etc. the only common part with the current project would be the pdf generation with pupetteer, and that’s 3 lines. I totally get the appeal though, I’d do one based on Vue if I had time. But by proposing REACT as a framework you are restricting the software to hardcore frontend developers. Pug, on the other hand, has nothing scary about it, anyone with a bit of HTML experience can get started on making documents with it.
It seems that there is a consensus not to add the feature, closing.