Rich-Harris/agadoo — 546★ trên GitHub (JavaScript). Check whether a package is tree-shakeable
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Tells you whether the JavaScript library you're building is tree-shakeable.
What it doesn't do
Tell you why tree-shaking fails, if it does. Maybe in a future version.
Hold up — tree what now?
With the advent of JavaScript modules (import and export), it's possible to build libraries that are tree-shakeable. This means that a user of your library can import just the bits they need, without burdening their users with all the code you're not using.
For example, the eases-jsnext library contains a grab-bag of Robert Penner's easing equations, presented as a JavaScript module. I can use it like this in my code...
import * as eases from 'eases-jsnext';
for (let t = 0; t <= 1; t += 0.05) {
const eased = eases.cubicInOut(t)
const str = repeat('*', eased * 20);
console.log(str);
}
function repeat(str, num) {
let result = '';
num = Math.round(num);
while (num--) result += str;
return result;
}
...and all the easing functions that I haven't used will get removed during bundling, if I'm using a modern bundler such as Rollup, webpack or Parcel. Here's what that bundle would look like with Rollup:
'use strict';
function cubicInOut(t) {
return t < 0.5
? 4.0 * t * t * t
: 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0
}
for (let t = 0; t <= 1; t += 0.05) {
const eased = cubicInOut(t);
const str = repeat('*', eased * 20);
console.log(str);
}
function repeat(str, num) {
let result = '';
num = Math.round(num);
while (num--) result += str;
return result;
}
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Rich-Harris/agadoo là nguồn chính thức.
Rich-Harris/agadoo có phải mã nguồn mở không?
Có — Rich-Harris/agadoo phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Rich-Harris/agadoo.
Rich-Harris/agadoo là gì?
Rich-Harris/agadoo (Rich-Harris/agadoo) là dự án JavaScript trên GitHub. Theo mô tả gốc: Check whether a package is tree-shakeable
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về agadoo?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về agadoo.