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

Overhaul export support to allow for manual mangling of reserved words #105

Closed
wants to merge 33 commits into from

Conversation

kristoferbaxter
Copy link
Contributor

@kristoferbaxter kristoferbaxter commented Nov 7, 2018

Ready for review. This CL is large, and refactors how imports and exports are parsed and recovered.

The motivation is to add support for a new second argument to the plugin creation from Rollup.

export interface TransformOptions {
  mangleReservedWords?: Array<string>;
  mangleSuffix?: string;
}

With mangleReservedWords, a user of the plugin can specify reserved words that the Plugin should ensure are properly renamed before Closure Compiler is invoked. This addresses #92.

Note: There are a lot of pitfalls for these kinds of changes to preserve the words (especially when a reserved word was used as an import or export).

@kristoferbaxter kristoferbaxter changed the title [WIP] Overhaul export support to allow for manual mangling of reserved words Overhaul export support to allow for manual mangling of reserved words Nov 7, 2018
Copy link
Contributor Author

@kristoferbaxter kristoferbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the README with information about this new configuration.

@kristoferbaxter
Copy link
Contributor Author

@prateekbh – this is ready for review now.

@prateekbh
Copy link
Member

will review this today


/**
* When outputting ES2017+ code there is neglagible differences between `const` and `let` for runtime performance.
* So, we replace all usages of `const` with `let` to enable more variable folding.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really safe to do so?

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

Successfully merging this pull request may close these issues.

3 participants