Hacker News new | ask | show | jobs
by c-smile 1801 days ago
For the note: Sciter ( https://sciter.com ) implements CalDOM features out of the box. But better.

In Sciter DOM and vDOM are equally honored.

This CalDOM's (DOM + vDOM population):

    _("#output-1")
      .append(
        _("+h1").text("Hello World!")
      );

In Sciter is

    document.$("#output-1")
      .append(<h1>Hello World!</h1>)
And this reactive CalDOM:

    let app = _().react(
        {},
        {
            render: state =>
                _( "+h1", `Hello ${state.name}` ) //This is XSS safe
        }
    )

    _("#output-2", app );

    //Edit below line to update state
    app.state.name = "World Reactively ";
in Sciter is

    class App extends Element {
       name = "unknown";
       render() {
         return <body><h1>Hello { this.name }</h1></body>;
       }
    }

    document.body.patch(<App />);

    document.body.componentUpdate({name:"World Reactively "}); // will invoke render()
3 comments

> But better.

This blunt dismissal is very rude when you don’t even mention that you are the author of sciter.

Yep I was thinking the same. Quite an idiot way to advertise your own product. I'll leave that link untouched.
Sciter is really great.
My pardon. Yes, I am an author of Sciter.
Not exactly "minimalistic" or "lightweight, though, is it?
"Better" here means that JSX and things like element.append(vDOM/JSX expr/) and Element.patch(vDOM/JSX expr/) are implemented natively - does not need any library at all.

Consider these features as an idea for browser vendors / W3C to extend DOM that we all use.

With these features (JSX & element.patch(vdom)) we don't need whole class of JS frameworks like React, PReact, Mithril. Vanilla JS (ES2020 spec) can be used instead. See: https://github.com/c-smile/sciter-js-sdk/tree/main/docs/md/r...

Did you forget to add that your library has a licensing cost? You don't get access to the source code unless you pay.
Sciter is free if it is used in binary form. Same thing as Google Chrome and MS Edge.