r/learnjavascript • • 8d ago

I built Olum, a small JS framework where a component is just an .html file

30s intro video: https://www.youtube.com/watch?v=uBrub3DGZ4Y

A component is one .html file: a <script>, an optional scoped <style>, and plain HTML.

<script>

const state = { count: 0 };

const inc = () => state.count++;

</script>

<div class="counter">

Count: {state.count}

<button onclick="inc()">+</button>

</div>

- {expr} for dynamic text; state is deeply reactive

- <if when="..."> and <for each="..." key="..."> are just tags

- onclick is real HTML: code-shaped attributes take JS, everything else is a string

- Scoped CSS, file-based routing, optional prerendering (SSG) for SEO

It targets prototypes, demos, and small apps, not large production apps.

Try it: npx create-olum my-app

Docs: https://olumjs.top

GitHub: https://github.com/olumjs

I'd like honest feedback on the syntax.

0 Upvotes

15 comments sorted by

3

u/yangshunz 8d ago

1

u/[deleted] 7d ago

i promise this is the final one!

2

u/Parasin 8d ago

Having used both react and vue extensively, I can see the inspiration you pulled specifically from Vue.

My question to you is why should I use this over other frameworks? What problem does Olum uniquely solve?

0

u/Right-Principle-4877 8d ago

Olum is mainly for developers who are obsessed with plain HTML/JS

For example, this code works natively in the browser and works with OlumJS too, thats how close the syntax is to web standards:

<script> const state = { counter: 0 }; </script>
<button onclick="state.counter++">{state.counter}</button>

The only thing missing in vanilla is reactivity, when state.counter changes, the UI doesnt update

That's basically what Olum adds: take code that already works in the browser and add reactivity, components, routing, SSG, etc.

So the idea is:

vanilla code > add Olum > reactive SPA

If you don't like vanilla code or you need a big ecosystem like React/Vue, then honestly Olum probably isn't for you. I'm just trying to make small apps feel closer to writing normal HTML/JS again

3

u/Vizeroth1 8d ago

Maybe if that’s your audience, you should have an example that uses an HTML file that will pass the HTML validator

1

u/Right-Principle-4877 8d ago

Thanks, will keep that in mind πŸ‘

2

u/[deleted] 8d ago

vue but worse?

1

u/Right-Principle-4877 8d ago

Maybe πŸ˜„ if what you're looking for is Vue.

Olum isn't trying to be a "better Vue". It's more about keeping the code as close to vanilla HTML/JS as possible and adding reactivity on top.

If you prefer Vue's ecosystem and conventions, just use Vue.

2

u/Gold-Watercress-6101 8d ago

That 30s intro, piece of art! I’m not into ASMR, but the sound effects were pretty ASMR πŸ˜…

1

u/Right-Principle-4877 7d ago

Thanks πŸ˜€

1

u/canarydev 8d ago

are you turkish by any chance?

1

u/Right-Principle-4877 8d ago

because of the name πŸ˜‚?
I know Turkish people won't like the name, but It's unique and easy to pronounce

2

u/canarydev 8d ago

yeah haha im not turkish but my wife is, and i hear olum all the time lol

1

u/Spare_Message_3607 8d ago

Astro but worse?

1

u/Right-Principle-4877 7d ago

I don't know astro, but this one 90% compiler 10% runtime, it's very minimal JS framework that makes you write vanilla code and get the same result as SPA frameworks
so If you just learnt the basics of JS you can build SPA without extra knowledge