Blog · GitLab (User) Created at 2018-3-12 13:08:28 Updated at 2018-4-28 10:23:45 Tomáš Hübelbauer
Add missing TypeScript configuration for Petit TSX

Petit

Trying out Petit with TypeScript and Parcel. Inspired by this benchmark.

Thanks to using TypeScript and Parcel, we get JSX/TSX without hassle.

Running

parcel index.html

Integrating

index.tsx:

import { h, mount, patch } from 'petit-dom';

let app = <div />;
window.addEventListener('load', async () => {
    document.body.appendChild(mount(app));
    await render();
});

async function render() {
    const temp = app;
    app =
        <div>
            {await …}
        </div>;
    patch(app, temp);
}

tsconfig.json:

{
    "compilerOptions": {
        "jsx": "react",
        "jsxFactory": "h"
    }
}
Changes (6)
2018-4-28 10:23:45 Tomáš Hübelbauer
Add missing TypeScript configuration for Petit TSX
2018-4-28 10:22:32 Tomáš Hübelbauer
Fix the incomplete example
2018-4-28 10:21:44 Tomáš Hübelbauer
Update README.md
2018-4-9 14:38:54 Tomáš Hübelbauer
Update patch pattern to a little nicer one
2018-3-17 09:45:01 Tomáš Hübelbauer
Plan adopting JSX pragmas in TS 2.8
2018-3-12 13:35:02 Tomáš Hübelbauer
Develop a Petit example
Comments E-mail me!