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

Is transform still supported in the version 3? #1949

Closed
OndrejSpanel opened this issue May 16, 2017 · 4 comments · Fixed by #1950
Closed

Is transform still supported in the version 3? #1949

OndrejSpanel opened this issue May 16, 2017 · 4 comments · Fixed by #1950

Comments

@OndrejSpanel
Copy link
Contributor

OndrejSpanel commented May 16, 2017

Is UglifyJS.transform and TreeTransformer (see lisperator.net) still supported in the version 3, or was it removed in #1872? It specifically mentions walk as supported, but there is no mention about transform:

AST node class names, utility functions, and traversers like TreeWalker can remain as is, as some uglify users analyze the AST.

I am using transform heavily and after upgrading to 3 it seems not working to me. It may be because I do something wrong (I am using UglifyJS from Scala.js, therefore the things are not straightforward for me). Walker works for me fine.

Before I inspect this in more detail, may I ask if transform removal was intentional?

@alexlamsl
Copy link
Collaborator

AST_Node.transform() is still exported because AST_Node is, but only TreeWalker, not TreeTransformer, is being exported.

It is intentional only in the sense that we are aiming to reduce the API surface area with UglifyJS 3. Feel free to submit a PR to export TreeTransformer around here:

https://github.com/mishoo/UglifyJS2/blob/4f8ca4626efb15dc986785c89c51cbb3061e5f32/tools/exports.js#L2

@alexlamsl
Copy link
Collaborator

I also noticed that we never had any documentation for TreeWalker and TreeTransformer, not even back in 2.x

@mishoo
Copy link
Owner

mishoo commented May 16, 2017

@alexlamsl There is some documentation on my website: TreeWalker and TreeTransformer. Unless there is a good reason to break or hide these API-s, I'd like them to stay…

@alexlamsl
Copy link
Collaborator

@mishoo noted - will add that one-liner to expose TreeTransformer 😉

Those APIs haven't changed at all from v2.x, so I think I can safely link to your documentation pages.

alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue May 16, 2017
- link to existing documentation on `TreeWalker` & `TreeTransformer`
- fix Travis build failures

fixes mishoo#1949
alexlamsl added a commit that referenced this issue May 16, 2017
- link to existing documentation on `TreeWalker` & `TreeTransformer`
- fix Travis build failures

fixes #1949
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

Successfully merging a pull request may close this issue.

3 participants