size-limit
tsdx
Our great sponsors
size-limit | tsdx | |
---|---|---|
6 | 45 | |
6,384 | 11,135 | |
- | 0.3% | |
8.6 | 0.0 | |
7 days ago | 10 months ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
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.
size-limit
-
How to build tree-shakeable JavaScript libraries
However, you can use the Size Limit library to control the size of a bundle or individual exports. Here’s an example configuration:
-
Trim the fat: tips for keeping bundle size small 🏋️
It's always good to keep track of these things over time so performance doesn't slide. Parcel, which I used for this project, has a helpful bundle analyzer (similar to the one for Webpack) that gives a nice visual overview of a project's bundle. This is especially helpful for identifying bundled dead code coming from packages that could be avoided with tree-shaking. There are also plenty of tools you can integrate with CI to enforce bundle size.
-
Understanding nouns with tinyplural
TSDX is a great package for npm packages like this and even bundles with size-limit to check your gzipped final bundle size. Keeping a tiny package was really important to me so there are 0 dependencies and size-limit made me realise that simplifying all of my checking functions into 1 or 2 core functions that took options would be a better strategy and help reduce the code size.
-
Codebytes: Shorter UUIDs with collision prediction using nanoid
Small. 130 bytes (minified and gzipped). No dependencies Size Limit controls the size.
-
7 Trending projects on GitHub for JavaScript developers
Size Limit is a performance budget tool for JavaScript. It checks every commit on CI, calculates the real cost of your JS for end-users, and throws an error if the cost exceeds the limit. Link: https://github.com/ai/size-limit
-
Egghead's State Management Portfolio Club Journey - Week 1: An RDD Approach
-Mark Erikson and Joel Hooks talk on Redux -When and when not to reach for Redux -Redux Introduction -Egghead course by Dan Abramov on Fundamentals of Redux -RDD article by Tom Preston Werner -Another Article on RDD -Article on writing a great Readme -RDD Readme Example: size-limit
tsdx
-
ReactJS Good Practices
tsdx - Zero-config CLI for TypeScript package development
-
Using Next.js components in a custom npm library
Thanks for the insight fellas. Aside question, I was thinking of bootstrapping the project with tsdx, but their last release was well over 2 years ago. Wondering if there are any alternative options for creating libraries?
-
Rollup Library Starter
NOTE: If your project uses TypeScript, I would suggest using tsdx instead.
-
Creating Modern npm Packages
Sadly, it's a bit dead. We switched to dts-cli fork, but tsup looks good too
Used https://tsdx.io/ recently to do this, saved a lot of time and effort.
-
TypeScript is terrible for library developers
I don't depend on the actual typescript docs much but thankfully in @types and in tons of repos there are examples of well written typescript code.
The amount of JS and TS out there is also a bit of a foot gun though so stick with heavily used/starred libs if you aren't sure.
One tool that helps a lot with developing libraries in typescript is TSDX[0] or its successor dts-cli[1] and there is a bunch of good stuff in awesesome-typescript[2].
Maybe library devving is harder?(more work?) with tyepscript but it is worth it for the end developer, especially if that end developer is you. If you aren't using your own libs then you're probably getting paid by someone else to make them or... idk.
-
How to create your own React Components library
We will use a TSDX library - this tool is something similar to create-react-app, but for creating components library. It allows as to initialize a project immediately with already set up bundler, Rollup with Typescript supporting, testing with Jest, code formatter, Prettier and Storybook.
-
Is there a point in writing in TypeScript personal projects that I will maintain myself?
May be you need to try https://tsdx.io/
-
The Node ecosystem (still) has tooling problems
So what is the ideal way to build TypeScript libraries? I've heard that tsdx https://tsdx.io/ is quite good
-
How to include dependent types in library build?
I'd just add the types as a dependency but if you want to bundle them then afaik https://github.com/jaredpalmer/tsdx can do it (though I have never tried).
What are some alternatives?
Microbundle - 📦 Zero-configuration bundler for tiny modules.
turborepo - Incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust – including Turborepo and Turbopack. [Moved to: https://github.com/vercel/turbo]
parcel - The zero configuration build tool for the web. 📦🚀
tsup - The simplest and fastest way to bundle your TypeScript libraries.
create-react-app - Set up a modern web app by running one command.
nx - Smart Monorepos · Fast CI
esbuild - An extremely fast bundler for the web
twin.macro - 🦹♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
rollup-react-example - An example React application using Rollup with ES modules, dynamic imports, Service Workers, and Flow.
Tailwind CSS - A utility-first CSS framework for rapid UI development.
Next.js - The React Framework
semantic-release - :package::rocket: Fully automated version management and package publishing