DEV Community

Ryo Suwito
Ryo Suwito

Posted on

Neuer: Redefining Separation of Concerns While Everyone Else Rebuilds the Empire

Once in a generation, something comes along that doesn’t just challenge the status quo—it bulldozes it and plants a flag of unshakable dominance. React, Vue, Svelte? They’ve spent years building castles in the sky, tangled in debates over SSR, CSR, and the "right way" to separate concerns. But Neuer?

SSR or CSR? Neuer says, "Why not both? Or neither? Or whatever you need right now?"

Separation of concerns? Neuer doesn’t just separate—it lets you pick and choose how, when, and where. Dynamically fetch content, reuse pre-rendered HTML, or distribute standalone modules with no friction. With Neuer, it’s not about rebuilding the empire—it’s about reshaping the front-end universe exactly how you want it, when you want it.


Neuer: Where "Separation of Concerns" Means Whatever You Want

Neuer’s get template() isn’t a limitation—it’s a freaking superpower. It’s not just a function; it’s a canvas of unlimited potential. Let’s take a minute to bask in the brilliance of Neuer’s boundless adaptability:


Example 1: Everything in One File

Here’s your fully self-contained class:

export class DropdownButton extends Module {
    static {
        this.registerElement();
    }

    get template() {
        return `
            <div class="dropdown">
                <button class="btn" c-click="toggleDropdown">Click Me <span class="caret"></span></button>
                <div class="dropdown-content">
                    <slot></slot>
                </div>
            </div>
        `;
    }

    get styles() {
        return `
            .dropdown {
                position: relative;
                display: inline-block;
            }
            .dropdown-content {
                display: none;
                position: absolute;
                background-color: white;
            }
            .dropdown-content.show {
                display: block;
            }
        `;
    }

    toggleDropdown() {
        const content = this.querySelector('.dropdown-content');
        content.classList.toggle('show');
    }
}
Enter fullscreen mode Exit fullscreen mode

Boom. One file. One class. One revolution.


Example 2: Dynamic Fetch from Separate Files

Let’s split the template and styles into .html and .css files:

dropdown.html:

<div class="dropdown">
    <button class="btn" c-click="toggleDropdown">Click Me <span class="caret"></span></button>
    <div class="dropdown-content"><slot></slot></div>
</div>
Enter fullscreen mode Exit fullscreen mode

dropdown.css:

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
}
.dropdown-content.show {
    display: block;
}
Enter fullscreen mode Exit fullscreen mode

Now, update your class:

export class DropdownButton extends Module {
    static {
        this.registerElement();
    }

    async get template() {
        const response = await fetch('/templates/dropdown.html');
        return await response.text();
    }

    async get styles() {
        const response = await fetch('/styles/dropdown.css');
        return await response.text();
    }

    toggleDropdown() {
        const content = this.querySelector('.dropdown-content');
        content.classList.toggle('show');
    }
}
Enter fullscreen mode Exit fullscreen mode

Fetch it dynamically. Use it dynamically. No limits.


Example 3: The Relic-Powered SSR Hybrid

Want to use ancient relics like PHP to pre-render the template? Sure. Pre-bake the HTML server-side and pass it directly into your class.

dropdown.php:

<div class="dropdown">
    <button class="btn" c-click="toggleDropdown">Click Me <span class="caret"></span></button>
    <div class="dropdown-content">
        <?php echo $dropdownContent; ?>
    </div>
</div>
Enter fullscreen mode Exit fullscreen mode

Then, Neuer can ship JS-only logic to bind dynamic behaviors to your pre-rendered content:

export class DropdownButton extends Module {
    static {
        this.registerElement();
    }

    async get template() {
        const response = await fetch('/templates/dropdown.php');
        return await response.text();
    }

    toggleDropdown() {
        const content = this.querySelector('.dropdown-content');
        content.classList.toggle('show');
    }
}
Enter fullscreen mode Exit fullscreen mode

SSR + CSR without the drama.


Why Neuer Leaves the Big Three in the Dust

  1. React’s Overhead? Nope.

    Neuer skips hydration and doesn’t need a virtual DOM to "reconcile" anything.

  2. Vue’s Directive Soup? Not Here.

    Neuer templates are pure HTML—write them how you like, serve them how you like.

  3. Svelte’s Rewrites? Forget About It.

    Neuer lets you reuse logic, templates, and styles without duplication.


The Moral of the Story

Neuer doesn’t just blur the lines between CSR and SSR—it erases them entirely. While React, Vue, and Svelte fight over who has the least painful hydration strategy, Neuer simply says:

"Why not both?"

You want modularity? You’ve got it.

You want flexibility? Oh, you’ve got that too.

You want to pre-render with PHP, dynamically fetch from an API, or ship self-contained modules?

Neuer doesn’t care—it just works.


Closing Statement

But no… it’s too simple to be true, right? You’re probably thinking:

"There’s no way it’s this flexible. No way it’s this fast. No way it can handle SSR, CSR, and everything in between without breaking a sweat."

You must be asking yourself:

"What’s the catch? Surely, Neuer has some hidden complexity, some crippling limitation, some gimmick that will shatter the illusion!"

Guess what? There isn’t one. 😏

No magic tricks. No cheating. Just clean architecture, unlimited flexibility, and real-time adaptability that works right out of the box. While the other frameworks are busy building convoluted pipelines, debating hydration strategies, and arguing over separation of concerns, Neuer just works.

So, if you’re still looking for the "catch," I’ve got bad news for you:

The only thing Neuer is catching… is your competitors slipping. 👏

This isn’t just a redefinition. This is the reality you’ve been waiting for.

You’re welcome. 😏

Top comments (0)