Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
AI & KI NachrichtenAI Restrictions at NYCPS and LAUSD Reverberate Nationwide(24.09.2026 um 01:16 Uhr)
AI & KI NachrichtenMeta Connect 2026: The biggest news and announcements(24.09.2026 um 00:45 Uhr)
AI & KI NachrichtenMeta ditches the camera on its newest smart glasses(24.09.2026 um 01:37 Uhr)
AI & KI NachrichtenMuse is coming to Meta smart glasses(24.09.2026 um 01:40 Uhr)
AI & KI NachrichtenAI Restrictions at NYCPS and LAUSD Reverberate Nationwide(24.09.2026 um 01:16 Uhr)
AI & KI NachrichtenMeta Connect 2026: The biggest news and announcements(24.09.2026 um 00:45 Uhr)
AI & KI NachrichtenMeta ditches the camera on its newest smart glasses(24.09.2026 um 01:37 Uhr)
AI & KI NachrichtenMuse is coming to Meta smart glasses(24.09.2026 um 01:40 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Build Reactive Web Components with SSR

Traditional way of writing Web Components is not very SSR (Server Side Rendering) friendly. In this post, I show you how you can build reactive Web Components that work with SSR and with any JavaScript framework (Vue, React, Svelte, Solid,…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Traditional way of writing Web Components is not very SSR (Server Side Rendering) friendly. In this post, I show you how you can build reactive Web Components that work with SSR and with any JavaScript framework (Vue, React, Svelte, Solid, Brisa) or Vanilla JS.




  • Introduction

  • Writting a Web Component with Brisa

  • Building the Web Component

  • Loading the Web Component in a Vanilla JS project

  • SSR of the Web Component

  • Tell me more about Brisa... Please...

  • Note for Web Component library creators

  • Example

  • Conclusion






Introduction



We are going to use Brisa Web Component Compiler. Brisa is a web framework that, besides being similar to other frameworks like Next.js or Nuxt.js, also allows you to build reactive Web Components that work with signals for reactivity, with JSX and with SSR.





Brisa logo
Brisa logo





In order to do this, you only need to know the syntax of Brisa when writing Web Components. Brisa is not yet public as it is currently at 95.48% of the v0.1 routemap, but we estimate that in 1 month it will be ready for launch and everyone will be able to access it. However, even if it is not public at all, you can already use it to create your own Web Components libraries.






Writting a Web Component with Brisa



As an example, we are going to write a Web Component of a counter, as always, the classic example.



counter-wc.tsx




import type { WebContext } from "brisa";

export default function CounterWC(
{ start = 0, color = "#2cebcf" }: { start?: number; color?: string },
{ state, css }: WebContext,
) {
const count = state(start);

css`
button {
background-color:
${color};
color: white;
border: none;
border-radius: 5px;
padding: 10px;
margin: 5px;
cursor: pointer;
}
div {
display: flex;
justify-content: center;
align-items: center;
}
`
;

return (
<div>
<button onClick={() => count.value++}>+</button>
{count.value}
<button onClick={() => count.value--}>-</button>
</div>
);
}






Brisa uses the name of the files to know the selector, here the selector would be counter-wc.




TIP: Although Brisa is not public yet, you can use TypeScript types to guide you on how to write Web Components.




In the example above, state is used to create a signal and then using the .value you make it reactive inside the JSX. The props are also special signals, since as they are read-only, the .value is not used to make it easier to use and to define default values more easily, this is done through build-time optimizations, similar to React to act as if they were using signals but the other way around.



The css template literal allows it to react to reactive changes in this case of the color property. This css template literal outside of this example is very useful for making reactive animations easily. It is important to remember that Web Components work with Shadow DOM, so the CSS does not affect the rest of the page.






Building the Web Component



To build the Web Component, you need to run the following command:




brisa build -w counter-wc.tsx






This command will generate 2 files:




[ wait ]  🚀 building your standalone components...
[ info ]
[ info ] Standalone components:
[ info ] - build/counter-wc.client.js (670.00 B)
[ info ] - build/counter-wc.server.js (842.00 B)
[ info ]
[ info ] ✨ Done in 42.20ms.






These files are not the Web Component, it is only the rendering function of the Web Component optimized at build-time to be as light as possible (the bytes that come out are without gzip).



So, how do we load the Web Component?






Loading the Web Component in a Vanilla JS project



To do this, you need to add the importmap in the HTML with brisa/client and then import the counter-wc.client.js file:




<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Brisa Web Component Example</title>
<script type="importmap">
{
"imports": {
"brisa/client": "https://unpkg.com/brisa@latest/client-simplified/index.js"
}
}
</script>
<script type="module" src="https://unpkg.com/counter-wc@latest"></script>
</head>
<body>
<counter-wc start="15"></counter-wc>
</body>
</html>






Here only the rendering part would be ported in each web component file, while they would all use the same Brisa wrapper defined in the importmap, which is responsible for creating the Web Component with the signals and the shadow DOM.






SSR of the Web Component



SSR of a Web Component can now be done thanks to Declarative Shadow DOM. The counter-wc.server.js file has already been compiled with this behavior, so you only need to import it on your server and render it in the HTML and adapt it to your server framework.



Here is an example with Bun.js or Node.js without using JSX:



ssr.js




import { renderToString } from "brisa/server";
import { jsx } from "brisa/jsx-runtime";
import CustomCounter from "counter-wc/server";

const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Brisa Web Component Example</title>
<script type="importmap">
{
"imports": {
"brisa/client": "https://unpkg.com/brisa@latest/client-simplified/index.js"
}
}
</script>
<script type="module" src="https://unpkg.com/counter-wc@latest"></script>
</head>
<body>
${await renderToString(jsx(CustomCounter, { start: 10 }))}
</body>
</html>
`
;

console.log(html);






Then run bun run ssr.js and you will see the HTML with the rendered web component using the Declarative Shadow DOM.






Tell me more about Brisa... Please...



The integration of these Web Component libraries with Brisa is done through a configuration file:




import type { WebComponentIntegrations } from "brisa";

export default {
"custom-counter": {
client: "./path/to/web-component.client.js",
server: "./path/to/web-component.server.js",
types: "./path/to/web-component.types.d.ts",
},
} satisfies WebComponentIntegrations;






In this way, SSR and TypeScript types are automatically integrated into your project. And you can use the Web Component in any Server Component or within another Web Component.



Typescript types



If you are interested in knowing more, I invite you to subscribe to the Brisa newsletter to receive the latest news and updates on Brisa. We estimate that by the end of September it will be ready for launch.






Note for Web Component library creators



We encourage you to try Brisa to create your own Web Component libraries. If you put the "made with Brisa" badge, we will put a link to your library on the Brisa page.





Made with Brisa






<a href="https://brisa.build" target="_blank" rel="noopener noreferrer">
<img
width="150"
height="42"
src="https://aralroca.com/images/blog-images/brisa_badge.svg"
alt="Made with Brisa"
/>
</a>









Example



If you want to see the GitHub repository of the example of the counter that we have explained in this article, you can take a look and use it as a reference for your own creations:








Conclusion



In this post, we have seen how to build reactive Web Components that work with SSR and with any JavaScript or Vanilla JS framework. We have used Brisa to build the Web Component and we have seen how to load it in a Vanilla JS project and how to do SSR with it.



I hope you have enjoyed this post and that you have learned something new. If you have any questions, do not hesitate to ask me in the comments below. I will be happy to help you.



Happy coding and enjoy the rest of the summer! 🌞🌴





Summer


Enjoy the rest of the summer!
IR-PLAYBOOK-VULN-REMEDIATION
MEDIUM
SOC Incident Playbook: Vulnerability Remediation & Verification
1-Click Detection Engineering: Sigma & YARA Rules
SOC Ready
title: Detect Exploitation - Build Reactive Web Components with SSR
id: 5161d5a7-a2d4-4afe-97b4-edffc932e834
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Build Reactive Web Components " ascii wide
    condition:
        any of them
}
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Build Reactive Web Components with SSR

Thematisch verwandte Begriffe: Build, Reactive, Components, with · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96676 | A vulnerability was identified in Fast FAC1900R 20190827_2.0.2. The impa…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick