Releases: HapticX/happyx
Releases · HapticX/happyx
CLI and templates
Since version 0.8.0 HappyX Provides own CLI tool that allows to create and serving projects written in HappyX
Changelog
CLI
🔧
Two commands available now:hpx create
: create HappyX project and (SPA/SSG).hpx dev
: serving HappyX SPA project.
templates
👔
Since version 0.6.0 HappyX support templates vianimja
template engine.
v0.5.2
v0.5.1
SPA, States And More Other 🎉
In this release we added powerful state management and components!
Components
Project structure:
project/
-- components/
-- -- hello_world.nim
-- main.nim
project/components/hello_world.nim
import happyx
component MyComponent:
counter: int
`template`:
{self.counter}
button:
"Increase"
@click:
self.counter += 1
`script`:
echo self.counter
`style`:
"""
button {
background: #212121;
color: #dfdfdf;
padding: 12px {self.counter + 1}px;
}
"""
project/main.nim
import happyx
var app = registerApp()
app.routes:
"/":
component MyComponent(counter = 5)
app.start()
v0.5.0
v0.4.8
Changelog
- Support
staticDir
inSSG
routing (#8).server.routes: staticDir "myDirectory"
- Support regex patterns
SSG
routing (#9).server.routes: "/regex/pattern{patternId:/[a-zA-Z0-9_]/}" echo patternId
- Support
SPA
withJS
backend.var app = newApp() app.routes: "#/": echo path buildHtml(`div`): "Hello, world!" "#/hello!": buildHtml(`div`): "No, bye!" app.start()
- New syntax sugar (#10).
- Some fixes and improves (#11)
v0.4.6
Changelog
- Support
middleware
(#3) and request methods (#3) in server 🌟server.routes: get "/": req.answer "Root via GET" post "/": req.answer "Root via POST" middleware: echo req
- Support
JSON
andHTML
answers (#2) 📤var server = newServer() userId = 0 server.routes: get "/html": req.answerHtml: buildHtml(`div`): script(src="https://cdn.tailwindcss.com") # Tailwind CSS :D `div`(class="bg-gray-700 text-pink-400 px-8 py-24"): "Hello, world!" post "/user": inc userId req.answerJson {"response": {"id": %userId}}
- Some improves and fixes 🐛
v0.4.5
Changelog
- Support variables in strings in
if
andfor
statements - Support attributes and children
if
andfor
statements - Support variables in curly brackets:
var state = remember true var html = buildHtml(`div`): {state}
if
andfor
statements does not generates root tags.