Skip to content

Instantly share code, notes, and snippets.

View phpnode's full-sized avatar

Charles Pick phpnode

View GitHub Profile
@phpnode
phpnode / esx.md
Created November 8, 2022 12:53 — forked from WebReflection/esx.md
Proposal: an ESX for JS implementation

About

In a quest to explore improvements over common JSX transformers I have managed to find great performance able to compete with template literal based libraries.

In this document I would like to describe, via JS itself, and as PoC, how JSX could be both rebranded as ESX and improved.

Goal

Differently from E4X, but also differently from JSX, this proposal leaves developers provide their own "render" implementation, freeing ESX usage from any previous attempt to confine JSX or E4X into the DOM world, where it's been proven, in the JSX case, it's not really where it belongs, as it can be used as neutral DSL.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Array#forEach</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<x-element></x-element>
<x-another-element></x-another-element>
<!-- web components should not modify anything apart from their children -->
<x-another-element>
<p>lala</p>
</x-another-element>