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

Better support for property mangling #38

Closed
stalniy opened this issue Apr 9, 2020 · 4 comments
Closed

Better support for property mangling #38

stalniy opened this issue Apr 9, 2020 · 4 comments

Comments

@stalniy
Copy link
Contributor

stalniy commented Apr 9, 2020

The issue is that I cannot mangle properties in my app due to destructuring of private properties in minisearch.

I configure terser to mangle all properties that start from _ but due to destructuring on this line search in my app doesn't work.

As a temporary workaround I marked _tree and _prefix as reserved props.

I'd appriate if you could change this and not use properties that stars with _ in destructuring assignments

@janwirth
Copy link

janwirth commented Apr 9, 2020

Maybe using _ as suffix a rather than prefix would do it?

@lucaong
Copy link
Owner

lucaong commented Apr 9, 2020

I will create a release avoiding the destructuring of those two fields. In general, I wouldn't change the library to accommodate build tools, as the build tools themselves can be configured, and there are too many possible setups in the wild to account for all of them. In this case though, it makes sense, as it is quite an established convention that variables starting with _ are private, or unused variables.

In general, the index serialization code is one feature that I want to change in the near future. The current serialization is too tightly bound to a specific inverted index implementation, and could hinder further improvements of MiniSearch that have to modify the data structure.

@lucaong
Copy link
Owner

lucaong commented Apr 10, 2020

I will close this issue, as it is fixed by this commit and will be part of the next release.

@lucaong lucaong closed this as completed Apr 10, 2020
@lucaong
Copy link
Owner

lucaong commented Apr 10, 2020

Released as part of v2.2.2

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

3 participants