Git Product home page Git Product logo

preact-on-the-edge's Introduction

Preact on the Edge

react-on-the-edge but on top of Preact. It uses esbuild for bundling and Vercel Edge Functions for SSR.

This example is for framework builders and advanced usage of the low-level Vercel Build Output API. If you're looking to develop a Preact application with dynamic Edge capabilities, we recommend Next.js Middleware and Vercel Edge Functions, with preact/compat.

How to use

Run pnpm i then:

  • To build: pnpm build
  • To run a local server: pnpm start

After building, .vercel/output will be created which you can deploy via vc --prebuilt.

Architecture

  • util/build.mjs implements the build process on top of esbuild that bundles src/app into an Edge Function.
  • util/start.mjs implements a local server using the edge-runtime package that can locally run the build outputs.

Developing

Due to the absence of a dev server, watchexec can be used as a replacement. Use brew install watchexec to install.

watchexec -c -r --no-meta 'node util/build.mjs; node util/start.mjs'

preact-on-the-edge's People

Contributors

epiqueras avatar developit avatar leerob avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.