The language is based on the CSS-like syntax with JS and XHTML inserts.
If you are familiar with Slim/Jade/Pug, then problems with understanding will not arise.
The project is in active development and it can be collected only in one way:
git clone [email protected]:artifact-project/exility.git
cd exility
npm i
npm run dev
npm test
— running all tests
- todo
- Ultimate isomorphic render
- Out of the box
- Ready to use UI libraries:
- Flexible and easy syntax :]
- Several compilation modes:
string
,dom
- Compiling into a pure function without dependencies
- Generating a minimum code with preliminary optimizations
- NativeDOM (no slow VirtualDOM)
- The single ecosystem on TypeScript.
- etc.
- block — Basic "Block" for building UI (based on web components spec).
- css — CSS in JS (minimally necessary functional).
- dom — DOM Renderer (isomorphic)
- form — Working with forms in all its glory.
- jacket — Utility for testing your ui-blocks.
- parser — Language parser.
- stdlib — A set of standard libraries.
- storybook — A special wrapper over the original storybook.
- string — String Renderer
- ts-transformer — TypeScript transformer for template precompilation
.foo.bar
-><div class="foo bar"/>
h1.caption
-><h1 class="caption"/>
.welcome | Hi!
-><h2 class="welcome">Hi!</h2>
form[method="post"]
-><form method="post"/>
input[type="text"][value="..."]
— css-like enumerableinput[type="text" value="..."]
— space separated
- className:
.is-${state}.${someClassName}
- tag + className:
${tagName}.is-${state}
- attributes:
form[method=${type} action="api/${method}"]
- text:
h1 | Hi, ${username}!
// Bla-bla-bla
.text | ok
.text |>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean mattis at sapien elementum tempor.
Aliquam consequat egestas nisl quis pharetra.<|
.main |# Click <a href="#next">me</a>. #|
.panel
.&-title > h1 | ${title}
p.&-text | ${text}
⏬ ⏬ ⏬
<div class="panel">
<div class="panel-title"><h1>...</h1></div>
<p class="panel-text">...</p>
</div>
i.left + i.right
⏬ ⏬ ⏬
<i class="left"></i><i class="right"></i>
.panel
.&-title > .&-close + | Wow!
.&-content | Bla-bla-bal
⏬ ⏬ ⏬
<div class="panel">
<div class="panel-title">
<div class="panel-title-close"><div>
Wow!
</div>
<p class="panel-content">Bla-bla-bal</p>
</div>
.button[class.&_${attrs.type}=${true}]
| ${attrs.text}
⏬ ⏬ ⏬
<div class="button button_primary">
OK
</div>
// Define
btn = [text, type]
button.btn[class.&_${attrs.type}=${true}]
| ${text}
// Usage
btn[text="Continue"]
btn[text="Send" type="primary"]
⏬ ⏬ ⏬
<button class="btn">Continue</div>
<button class="btn btn_primary">Send</div>
// Define
box = []
.box > ::children // Call default
// Usage
box
h2 | News
p | ...
⏬ ⏬ ⏬
<div class="box">
<h2>News</h2>
<p>...</p>
</div>
// Define
panel = []
.&__head > ::head // Call slot
.&__body > ::body
// Usage
panel
// Define slot
::head > h2 | Wow!
::body > p | Bla-bla-bla...
⏬ ⏬ ⏬
<div class="panel">
<div class="panel__head"><h2>Wow!</h2></div>
<div class="panel__body"><p>Bla-bla-bla...</p></div>
</div>
a[<]
— beforea[>]
— aftera[<>]
— at both sides
p > img[<] + img[<>] + img[>]
⏬ ⏬ ⏬
<p> <img/> <img/> <img/> </p>
if (js-expr)
| Yes
else if (!attrs.value)
| No
else
| Unknown
// Basic
ul > for (val in attrs.values) > li | ${val}
// Key/Value
ul > for ([key, val] in attrs.values) > li | ${key}: ${val}
// Track By (best practices)
ul > for (item in attrs.list) track by id
li[data-id=${item.id}] | ${item.text}
const value = attrs.x + attrs.y;
b | ${value}
npm run dev
— the only waynpm test
— run tests on all subprojectsnpm run release -- [major|minor|patch]
— publish the current version and put the tag