All Projects → magicmark → tiny-treeshaker

magicmark / tiny-treeshaker

Licence: other
🌳🥤 A tiny codemod for tree shaking (experimental) 🌳🥤

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to tiny-treeshaker

codemod-v4
codemod cli for antd v4 upgrade
Stars: ✭ 84 (-8.7%)
Mutual labels:  codemod, jscodeshift
font-awesome-codemod
⚙️ Font Awesome codemod script
Stars: ✭ 46 (-50%)
Mutual labels:  codemod, jscodeshift
jscodeshift-typescript-example
jscodeshift typescript codemod example
Stars: ✭ 27 (-70.65%)
Mutual labels:  codemod, jscodeshift
preact-codemod
🍧 Shave some bytes by using Preact.
Stars: ✭ 39 (-57.61%)
Mutual labels:  codemod, jscodeshift
es5-function-to-class-codemod
📦 Transform ES5 Functions to ES6 Classes
Stars: ✭ 30 (-67.39%)
Mutual labels:  codemod, jscodeshift
async-await-codemod
Codemod script for migrating promise-based functions to use async/await syntax
Stars: ✭ 22 (-76.09%)
Mutual labels:  codemod, jscodeshift
ember-angle-brackets-codemod
Codemod to convert curly braces syntax to angle brackets syntax
Stars: ✭ 58 (-36.96%)
Mutual labels:  codemod, jscodeshift
ember-data-codemod
A codemod to upgrade to new ember-data packages
Stars: ✭ 13 (-85.87%)
Mutual labels:  codemod
Ts Migrate
A tool to help migrate JavaScript code quickly and conveniently to TypeScript
Stars: ✭ 4,246 (+4515.22%)
Mutual labels:  codemod
awesome-codemods
Awesome list of codemods for various languages, libraries and frameworks
Stars: ✭ 98 (+6.52%)
Mutual labels:  codemod
rn-update-deprecated-modules
Codemod to update import declarations as per react-native > 0.59.x deprecations.
Stars: ✭ 73 (-20.65%)
Mutual labels:  codemod
moment-dayjs-codemod
A Codemod to migrate from moment.js to day.js
Stars: ✭ 20 (-78.26%)
Mutual labels:  codemod
babel-codemod-example
An example of how to use babel as a codemod
Stars: ✭ 24 (-73.91%)
Mutual labels:  codemod
tscodeshift
tscodeshift is a toolkit for running codemods over multiple TS files
Stars: ✭ 49 (-46.74%)
Mutual labels:  codemod
django-codemod
A tool to automatically fix Django deprecations.
Stars: ✭ 145 (+57.61%)
Mutual labels:  codemod
graphql2ts
Transform .graphql to graphql-js typescript
Stars: ✭ 41 (-55.43%)
Mutual labels:  codemod
taro2-to-3
让 Taro2 项目自动升级到 Taro3 项目⚒️。
Stars: ✭ 31 (-66.3%)
Mutual labels:  codemod
babel-plugin-hyperscript-to-jsx
This plugin transforms react-hyperscript into JSX. Intended to be used as codemod.
Stars: ✭ 20 (-78.26%)
Mutual labels:  codemod
Astexplorer
A web tool to explore the ASTs generated by various parsers.
Stars: ✭ 4,330 (+4606.52%)
Mutual labels:  jscodeshift
gogoAST
The simplest tool to parse/transform/generate code on ast
Stars: ✭ 29 (-68.48%)
Mutual labels:  jscodeshift

🌳🥤 tiny-treeshaker

A really bad tiny tree shaker (experimental)

Why?

This is a bare-bones tree shaking codemod that can be adapted for targeting specific use cases.

(I made this cos i'm writing a seperate codemod for a migration I'm working on. The migration removes callsites to a bunch of random helper functions - which now eslint complains about, and I need to remove. Hence this tree shaking codemod.)

Existing solutions are very fancy pants and try and target everything and require complex setups. I want to only target a known set of things to tree shake away. (allowlist vs denylist).

The goal of this is to be:

  • small as possible (while still being "correct". This won't shake away things you use, but may not shake away everything you don't use.)
  • simple to understand / extend / chop and change as needed

Usage

  • Clone this repo
  • Install jscodeshift
  • Run with the CLI (e.g. jscodeshift --transform /path/to/tiny-treeshaker/src/index.mjs ...)

Work in progress

This doesn't shake everything away just yet (sorry!), but gets most of the common cases (i.e. enough to be used when targeting a specific thing)

What you should probably use instead

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].