GithubHelp home page GithubHelp logo

maidang1 / farm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from farm-fe/farm

0.0 0.0 0.0 20.21 MB

Extremely fast Vite-compatible web build tool written in Rust

Home Page: https://farm-fe.github.io

License: MIT License

JavaScript 3.44% Rust 64.73% TypeScript 29.37% CSS 0.57% HTML 0.17% Vue 1.66% Svelte 0.07% Shell 0.01%

farm's Introduction

Extremely fast Vite-compatible web building tool written in Rust

English | 简体中文

discord chat npm package node compatibility downloads license



Intro

Farm is a extremely fast vite-compatible web-building tool written in Rust. It's designed to be fast, powerful and consistent, aims to provide best experience for web development, which is the real next generation build tool.

Online experience

Edit Farm

Why Farm?

See Why Farm for details.

In short, tools like webpack are too slow, but new tools like Vite are not perfect, Vite has a lot of drawbacks when comes to a large project:

  • A huge number of requests during development:when there are hundreds or thousands modules per page, loading performance severely degraded, it may takes seconds or more when refresh the page.
  • Inconsistency between development and production: Using different strategy and tools in development and production, it's really inconsistent and it's hard to debug online issues.
  • Inflexible Code Splitting: It's hard to control the output of your bundles.

Farm can solve these problems perfectly, and it's really fast cause it's written in Rust. Farm aims to be fast, consistent, flexible, which is the real next generation build tool.

Features

Note

  • Extremely Fast: Written in Rust, start a React / Vue project in milliseconds and perform an HMR update within 20ms for most situations.
  • Incremental Building: Support persistent cache, module level cache enabled by default, any module won't be compiled twice until it's changed!
  • 🧰 Fully Pluggable and Vite Compatible: Everything inside Farm is powered by plugins, Support Vite Plugins out of box. Supports Farm compilation plugins(both Rust and JavaScript plugins, and SWC plugins), Farm runtime plugins and Farm server plugin.
  • ⚙️ Powerful: Compiles JS/TS/JSX/TSX, CSS, Css Modules, HTML, and static assets out of the box. Support official compilation plugins for Popular frameworks/tools like React, Vue, SolidJs, Sass, Less, Postcss and so on.
  • ⏱️ Lazy Compilation: Dynamically imported resources are compiled only when requested, speed up compilation for large scale project. Just write a dynamic import and the imported module won't be compiled when it is executed.
  • 📦 Partial Bundling: Bundle your project into a few reasonable bundles automatically, speeding up resource loading without losing caching granularity. Refer to RFC-003 Partial Bundling for details.
  • 🔒 Consistency: What you see in development will be the same as what you get in production.
  • 🌳 Compatibility: Supports both legacy (ES5) and modern browsers.

Farm has implemented all features of a web build tool, including production optimization like tree shake and minification. It's now 1.0 stable. We have already migrated enterprise projects to Farm, and it works great!

See RFC-001 Architecture for design motivation and architecture.


Getting Started

Create a new Farm(support both React and Vue) project with your favorite package manager:

# with npm
npm create farm@latest
# with yarn
yarn create farm@latest
# with pnpm
pnpm create farm@latest

Visit Farm Documentation to learn more about Farm.

Benchmark

Farm is much faster than similar tool, 20x faster than webpack and 10x faster than Vite in the benchmark:

benchmark

See Benchmark for details.

Contribution

See Contributing Guide.

Chat With Us


Contributors




Contributors of farm-fe/farm New trends of farm-fe
Contributors of farm-fe/farm

Credits

Thanks to:

  • The SWC project created by @kdy1, which powers Farm's code parsing, transformation and minification.

  • The NAPI-RS project created by @Brooooooklyn, which powers Farm's node-binding implementation.

  • The Rollup project created by @lukastaegert, which inspired Farm's plugin system implementation.

  • The Vite project created by Evan You, which inspired Farm's compatibility design of ecosystem.

Author & Maintainer

Author:

Maintainer:

farm's People

Contributors

wre232114 avatar github-actions[bot] avatar erkelost avatar shulandmimi avatar callqh avatar nidmo avatar nirvana-jie avatar wjq990112 avatar oblador avatar ysy945 avatar ccherry07 avatar naturellee avatar rss1102 avatar chovrio avatar dependabot[bot] avatar siyou avatar molvqingtai avatar rhyzx avatar chuhoman avatar flora025 avatar ufec avatar fairyscript avatar maidang1 avatar motea927 avatar zourunfa avatar sorrycc avatar liangchaofei avatar kabutoa avatar xguangspbd avatar yoogoc 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.