eldoy / waveorb

Javascript web app development framework
https://waveorb.com
MIT License
5 stars 0 forks source link

Macros #127

Open eldoy opened 1 year ago

eldoy commented 1 year ago

Before loading the file, it would be cool to support "macros". Macros before, compile after.

Macros should swap or transform file content with other content, for example with pluss, JS language features, etc. functions.

In app/macros we could define functions that are callable but not included.

We could write:

fn hello() {
}

and get:

function hello() {
}

or

<.hello#some>

and get

<div class="hello" id="#some">

etc...

This could also be solved with a shadow editor, or a WYSINWYG.

eldoy commented 7 months ago

Implemented in HTML6 with onrequire callback using require-from-string. Current only works for .js files. Need onrequire callback for it to work.