-
Notifications
You must be signed in to change notification settings - Fork 132
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
minifying alters DataFactory types #172
Comments
Seems like we now need Not sure which is the best performance-wise. Maybe I should get rid of inheritance altogether. |
I never figured out how to x instanceof Term // or NamedNode or whatever so I wouldn't miss inheritance as a user. There are places where I want to see if something is an RDFJS term but i do that with: ["NamedNode", "BlankNode", "Literal"].indexOf(x.termType) !== -1 Otherwise, maybe modern terser fixes #135? |
I need at least a workaround for this. My use case is to modify ui elements based on the termType, so I need something predictable. |
I'm pleased to report that method 1 above works fine. Thanks. :-) |
Problem
using a minifier changes the names of the classes that extend Term.
Reproduced
MyModule.js
webpack.config.js
MyWebApp.html
Solution
There are two solutions: (1) advise users or (2) use static names for
Term.typeName
.1 Tell minifier, e.g. terser (was uglifier) not to compress class names:
For webpack, that looks like:
Term.termType
getters respond with static text:The text was updated successfully, but these errors were encountered: