Monocle
recast
Our great sponsors
Monocle | recast | |
---|---|---|
5 | 6 | |
1,630 | 4,821 | |
0.2% | - | |
8.2 | 6.1 | |
6 days ago | 21 days ago | |
Scala | TypeScript | |
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.
Monocle
-
Ref in cats-effect. When should I use it, and when should I not?
Without concurrency, using a Ref doesn't buy you anything over just using a var. If you want the benefits of immutability with an API that resembles mutability, you have to use something like Monocle.
-
Show HN: Monocle – bidirectional code generation library
A very popular Scala optics library is also called Monocle. I’ve been a happy user for a few years:
https://github.com/optics-dev/Monocle
-
Monocle 3 release candidate - a super useful and simple library for optics with poetic api
See example https://www.optics.dev/Monocle/
- Monocle 3.0.0-M1 is released for Scala 2.13 and Scala 3
-
Monocle 3 Roadmap
We always have work to do, for example to define scalfix rules to automate the migration https://github.com/optics-dev/Monocle/issues/1001
recast
-
What is an Abstract Syntax Tree in Programming?
GitHub | Website
-
[AskJS] Any good shortcuts for migrating off of enzyme?
If jscodeshift is confusing, I recommend looking into using recast directly, along with ast-types for AST traversal and its node factories. Inside your visitors, write some conditionals that check for the patterns you want to detect, then mutate the node passed to the visitor, or otherwise mutate the AST. Keep going until tests are passing.
-
Evan you on Svelte migration from Vue
I ended up writing my own codemod tool based on recast to automate most of the repetitive, mindless grunt work. Even with the tool shaving hundreds of hours off of the migration effort, there's still a huge amount of work left, since we need to find or create Vue 3-compatible alternatives of all of our Vue 2-only dependencies. Some of these dependencies (e.g. vee-validate) are used pretty ubiquitously too
-
Which library to use for AST manipulation?
I had great results with a combination of babel + recast. Babel is doing the job and Recast is mostly here to preserve the original style when printing code again. I animated a workshop @ Node.JS Montréal 2019 that was recorded here. We cover the parse/transform/print of code using Babel (live coding starts around 45').
-
JARVIS – Write me a Codemod
recast
- Show HN: Monocle – bidirectional code generation library
What are some alternatives?
Quicklens - Modify deeply nested case class fields
escodegen - ECMAScript code generator
Shapeless - Generic programming for Scala
espree - An Esprima-compatible JavaScript parser
Chimney - Scala library for boilerplate-free, type-safe data transformations
Acorn - A small, fast, JavaScript-based JavaScript parser
cats - Lightweight, modular, and extensible library for functional programming.
jscodeshift - A JavaScript codemod toolkit.
Scalaz - Principled Functional Programming in Scala
ast-node-finder - AST Node Find api automatically generated from code
Scala Graph - Graph for Scala is intended to provide basic graph functionality seamlessly fitting into the Scala Collection Library. Like the well known members of scala.collection, Graph for Scala is an in-memory graph library aiming at editing and traversing graphs, finding cycles etc. in a user-friendly way.
ts-lite - Compiled TypeScript. Generates Go, Swift, Kotlin, WASM, Binary