Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewml/lazy-babylon-to-estree
Lazily transform a Babylon AST into an ESTree AST
https://github.com/drewml/lazy-babylon-to-estree
babel babylon estree
Last synced: 4 days ago
JSON representation
Lazily transform a Babylon AST into an ESTree AST
- Host: GitHub
- URL: https://github.com/drewml/lazy-babylon-to-estree
- Owner: DrewML
- Created: 2018-01-04T02:18:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-04T05:44:29.000Z (about 7 years ago)
- Last Synced: 2024-12-06T17:25:59.088Z (2 months ago)
- Topics: babel, babylon, estree
- Language: JavaScript
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lazy-babylon-to-estree
[![CircleCI](https://circleci.com/gh/DrewML/lazy-babylon-to-estree.svg?style=svg)](https://circleci.com/gh/DrewML/lazy-babylon-to-estree)
WIP: Lazily "convert" a Babylon AST to the ESTree equivalent. Currently only converts `Literal`s. For the time being, the goal of this project is only to support the bare minimum transformations needed by `webpack`.
## Changelog
See [`Releases`](https://github.com/DrewML/lazy-babylon-to-estree/releases)
## Features
* Conversions happen lazily when a property on the AST is accessed
* Original AST is not mutated (besides 1 non-enumerable, symbol-keyed prop on the `Program` node)
* Referential Equality between nodes is maintained (`===`)
* Transformations occur as other code traverses the tree (this module does not perform a separate traversal of the AST)## Why?
This is an experiment I'm doing with `webpack` and `babel-loader` to try and prevent the double parsing of code, without having to create an entire transformed copy of the AST each time we go from `babel-loader` >> `webpack`. It's possible this will have no positive performance impact (or will even have a negative perf impact), but I'd never know if I didn't write the code 🕺.
## Missing Features/TODO
* `ObjectProperty` and `ObjectMethod` >> `Property`
* `ClassMethod` >> `MethodDefinition`