|
|
|
|
|
by eager_learner
24 days ago
|
|
function Greeting({ name }: { name: string }) {
return (
<div class="card">
<h1>Hello, {name}!</h1>
<p>Welcome to my site.</p>
</div>
);
} That looks like HTML, but it's TypeScript. It gets compiled to actual HTML. Can any Python framework do that?? In Python, you'd typically write your logic in Python and your HTML in a separate Jinja2 template file — two languages, two files, context-switching. With Fresh + TSX, your logic and your markup live together in one .tsx file, both in TypeScript, with full type-checking throughout. |
|
> That looks like HTML, but it's TypeScript. It gets compiled to actual HTML. Can any Python framework do that??
IMHO that's a terrible idea that no one should ever actually use, but if you are really in love with that, you can have it:
https://github.com/pyxy-org/pyxy