examples
swc
Our great sponsors
examples | swc | |
---|---|---|
32 | 139 | |
3,286 | 29,984 | |
3.7% | 1.4% | |
8.6 | 9.9 | |
5 days ago | 2 days ago | |
TypeScript | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
examples
-
Direct Postgres connection to Supabase from Vercel Edge in Next.js
Is anyone aware of a way to make a direct connection to Postgres with transaction support on Vercel Edge functions? The 'pg' package doesn't work on edge for me. The obvious answer would be @vercel/postgres but I find their lack of documentation rough and for whatever reason I can't get it to connect on my local computer using the Supabase-provided local database connection string. This is apparently a known issue (https://github.com/vercel/storage/issues/123, https://github.com/vercel/examples/issues/701) where in order to make this (or neon's package) work you need a WebSocket proxy? Is a direct Postgres connection from edge just impossible right now? Or do others have it working somehow?
-
Does anyone have any experience with using nextjs as frontend and flask as backend?
I have cloned this repo: https://github.com/vercel/examples/tree/main/python/nextjs-flask. I am using the repo to make an api call from the front end to the back end. when running fetch("/api") I get an error with status 500, why is that?
-
12 Super Cool Machine Learning Projects that you didn't know are Open Source and made of JavaScript
Demo: Alt Text Generator GitHub: Alt Text Generator Repository
-
Vercel Launches 3 New Storage Options for Your Next Project!
I copied the Template that they provide for the testing, you can get the template source on GitHub. I modified its page.tsx file just to set and get a value from the database.
-
Existing NEXTJS (T3) Site + Monolithic Wordpress-Woocommerce Shop -howto AUTHENTICATION?
Take a look at this example: https://github.com/vercel/examples/tree/main/solutions/subdomain-auth
-
Update on connection pooling with Vercel
So AFAIK now with Vercel Postgres is possible to have connection pooling using prisma out of the box, this means that no more bottlenecks with lots of clients connected to the web app right? Source: https://github.com/vercel/examples/blob/main/storage/postgres-prisma/prisma/schema.prisma
-
How to Revalidate PostgreSQL Server Component in Next JS?
I have a server component that reads a database table in this new way (Vercel Next JS Postgres Example). I also have a client component that updates that calls a fetch to update the same table. How can I ensure that the data in my server component doesn't grow stale?
-
How to use Redis with Vercel Edge
Additionally, Redis can be used in combination with Vercel Edge cache using: https://github.com/vercel/examples/tree/main/edge-api-routes/cache-control
- Convert serverless function to an Edge function.
-
Step by step: Multi-Tenant App with Next.js
Hostname rewrites example
swc
-
Storybook 8 Beta
First, we switched the default compiler for new projects from Babel to SWC (Speedy Web Compiler). SWC is dramatically faster than Babel and requires zero configuration. We’ll continue to support Babel in any project currently using it.
-
What is JSDoc and why you may not need typescript for your next project?
SWC
-
Implementing auth flow as fast as possible using NestJS
As the reference explains “**SWC** (Speedy Web Compiler) is an extensible Rust-based platform that can be used for both compilation and bundling. Using SWC with Nest CLI is a great and simple way to significantly speed up your development process.”
-
Ruby Outperforms C: Breaking the Catch-22
This is specifically about breaking the myth that performing expensive self-contained operations (e.g, parsing GraphQL) in a native extension (C, Rust, etc.) is always faster than the interpreted language.
The JS ecosystem has the same problem, people think rewriting everything in Rust will be a magic fix. In practice, there's always the problem highlighted in the post (transitioning is expensive, causes optimization bailouts), as well as the cost of actually getting the results back into Node-land. This is why SWC abandoned the JS API for writing plugins - constantly bouncing back and forth while traversing AST nodes was even slower than Babel (e.g https://github.com/swc-project/swc/issues/1392#issuecomment-...)
-
Building a Minimalist Docker Image with Node, TypeScript
Why Speedy Web Compiler ?
- TypeScript Is Surprisingly OK for Compilers
- Speedy Web Compiler: Rust-Based Platform for the Web
-
FTA: Fast TypeScript Analyzer
FTA is a TypeScript static analysis tool built on the speedy foundations of swc. FTA is fast; capable of analyzing more than 150 files per second on typical hardware, it offers a powerful addition to your code quality toolkit.
-
Show HN: Ezno, a TypeScript checker written in Rust, is now open source
Very cool! I'm curious, is this intended for dev tooling?
For example, I could see this (or something similar) being useful as the engine for a typescript language server that would be faster than the standard one
But if it's not aimed at 1:1 with tsc, would it be intended more for something like swc[1]?
Or what would you expect people to use this for, besides just being a cool project to learn from?
[1] https://github.com/swc-project/swc
-
TypeScript team released an explorer for performance tuning
This is... good news, but I still cannot fathom using the default Typescript compiler for regular development. Seriously, leave the type-checking to your IDE and CICD chain, and switch to using tsx (https://www.npmjs.com/package/tsx) or swc (https://swc.rs/) and you will _immediately_ notice the difference in speed and productivity.
What are some alternatives?
rwa-faunadb-reaflow-nextjs-magic - Real-world app example - Real-time Editor, using FaunaDB (realtime stream), Reaflow (graph editor), Next.js framework and a bit of Magic (auth)!
esbuild - An extremely fast bundler for the web
apps - daily.dev application suite
vite - Next generation frontend tooling. It's fast!
edge-functions
ts-loader - TypeScript loader for webpack
platforms - A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
tsup - The simplest and fastest way to bundle your TypeScript libraries.
developer-portal - Open source repo for the Sitecore Developer Portal (https://developers.sitecore.com)
vitest - Next generation testing framework powered by Vite.
watch-this
ts-node - TypeScript execution and REPL for node.js