Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Refactor: Implement chainable AST / functional AST handlers #9

Closed
barelyhuman opened this issue Jul 21, 2021 · 1 comment
Closed

Refactor: Implement chainable AST / functional AST handlers #9

barelyhuman opened this issue Jul 21, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@barelyhuman
Copy link
Owner

The current implementation generates the AST on every needed point instead of using the existing one if no modifications are made.

All code regarding this can be found in
lib/ast-helpers.js
lib/jsx-helpers.js

The needed change is to have a chainable contructor that allows doing the same manipulations as already in the functions but instead using a single ast as needed.

The other approach is to be functional and pass the ast around in the functions as a parameter, though that increases the amount of memory transferred around so the chain approach is preferrable.

Post the modification,
Test the application by visiting the web url : http://localhost:3000 or whatever port you have it on and then check if both the default code and the example code run (Click the View Example button ) properly without any issues.

@barelyhuman barelyhuman added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 21, 2021
@barelyhuman barelyhuman changed the title Refactor: Implement a chainable AST handler Refactor: Implement chainable AST / functional AST handlers Jul 21, 2021
@barelyhuman barelyhuman pinned this issue Jul 21, 2021
@barelyhuman
Copy link
Owner Author

407c247

Initial changes done,
can be optimized even more to reduce the transform time from the API for larger code snippets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant