Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform flyfile AST #8

Open
hzlmn opened this issue May 24, 2017 · 3 comments
Open

Transform flyfile AST #8

hzlmn opened this issue May 24, 2017 · 3 comments

Comments

@hzlmn
Copy link

hzlmn commented May 24, 2017

Seems like right now, fly-esnext just replace some syntax constructions using regular expressions. It would be nice if it use babylon or uglify etc. to transfrom file AST, it will be more correct behavior for syntax transformations.

@lukeed
Copy link
Owner

lukeed commented May 24, 2017

Yeah, correct. It's just regex replacements cuz they're the fastest and I only intended to support a few things. What are you missing?

@hzlmn
Copy link
Author

hzlmn commented May 25, 2017

@lukeed I am not missing something, it just could be confusion cuz if you write your export like

export      function test() {}

it won't be transformed 😄 . Also as i know global regexps not cheap and you scan source at least 4 times, so maybe it will be more efficient to transform it from AST. Also adding import transform will be easier.

@lukeed
Copy link
Owner

lukeed commented May 25, 2017

Lol, right. I assume normal whitespace variants ;-)

What do you mean about scanning source 4 times? I only scan once, during Fly boot up. It's actually MUCH faster than a babylon-parser (or any AST I tried).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants