ramonszo retweeted
Vite's SSR API is really slick.
Connect a vite server with a library like express through middleware.
Then you can use helper methods for adding Vite specific features while still having control over the rendering.

ALT import { createServer } from 'vite' import express from 'express' const app = express() const vite = await createServer({ server: { middlewareMode: true }, appType: 'custom', }) app.use(vite.middlewares) app.use('*', async (req, res) => { let indexHtml = fs.readFileSync('./index.html', 'utf-8'); let index = await vite.transformIndexHtml(url, indexHtml) const { render } = await vite.ssrLoadModule('/src/entry-server.js') const appHtml = await render(url) const html = template.replace(`<!--ssr-outlet-->`, appHtml) res.status(200).set({ 'Content-Type': 'text/html' }).end(html) })
ramonszo retweeted
I love JavaScript.
I can use a C library to convert video, and run an AI model with a C++ runtime.
This code will run on the server with NAPI or in the browser on the CPU with Wasm, or on the GPU with WebGPU
No install issues, no make, no pip kill me errors. Just an idiot JS dev writing a few lines of code 🥰
ramonszo retweeted
CSS magic: now you can animate height from 0 to auto via `calc-size(auto)`
Say goodbye to JS Calculate Height!
Combined with <details name="">, a nearly perfect and exclusive Accordion component can now be implemented.
@Una @davidbaron
codepen.io/yisi/pen/MWdajwr
ramonszo retweeted
Fire up the Lambos and meet usePHP. Run PHP in React, with edge SSR. Extracts your PHP code, executes it in WASM, and injects the result into your React code.
ramonszo retweeted
Realistic glass backdrop 🤯
In reality we see glass objects reflecting light even before they are placed directly between our eyes and the light source.
CSS backdrops, however, blur only intersecting objects. But I've found a solution to that!
Here's a demo on @linear website
ramonszo retweeted
its 2023 and you can now train your editor to read the docs and write code for you
ramonszo retweeted
🔥 JavaScript import maps are now in all the browsers! Here is how they work with ES modules.
this is amazing and scary at the same time 😂
GitHub Copilot Labs brushes is pretty amazing.
githubnext.com/projects/copi…
* Fix obvious bugs
* Write cleaner code
* List steps
* Make Robust
* Add Types
1
ramonszo retweeted
😴 CSS-in-JS
⚡️ Stitches-like variants w/ @tailwindcss
Cloudflare just launched its own CAPTCHA solution 😮 blog.cloudflare.com/turnstil…


















