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
Syntax Error in printable-characters.js #1
Comments
This problem exists in the latest version published on npm: |
The module is tested before publishing (via a continuous integration service), and the deployment process is fully automated by that service. You can see the test/build log here: https://travis-ci.org/xpl/printable-characters So a broken build can't get to NPM, really. The error you experience is caused by an outdated version of JS engine you use, which does not understand a modern JS syntax. In ES2015 we can use the shorthand property notation: var a = 'foo',
b = 42,
c = {};
// Shorthand property names (ES2015)
var o = {a, b, c}; See more here: |
If you still need the ECMAScript5 support (e.g. for older browsers), I'd suggest you to use Babel for transpiling your project: https://babeljs.io/ |
@xpl Hmm, I see. I have an issue with UglifyJS v2.8.26 which is less than 6 months old. You might want to consider waiting to use modern JS syntax until popular tools like that catch up. |
@fresheneesz I expect people (who develop browser apps) to use Babel on their end, it's like an industry standard nowadays. Just add it before Uglify in your build script, and you can use all the modern syntax and forget about the compatibility problems. But if you insist, I can pre-compile the library for you, putting the pre-built version right in the repository. It will just take some time to configure the CI build script properly... |
@xpl I don't want to have you change your package if its only to support someone not using best practices that are easy to do. I was just surprised this came up suddenly when I've never had a js version compatibility issue before. I would imagine that updating to newer versions of JS should start at the application level first, and only be required by things applications depend on (eg modules) after a certain amount of adoption has happened. I don't know the state of adoption of these things at this point. So ok, but I'm trying to add a babel step to my webpack 3 config and getting this issue: https://github.com/simlrh/babel-webpack-plugin/issues/1 . Maybe I'm just using an old version of node (5.1.0), but its not that old. Iono, I would imagine if I'm getting this issue, others will probably too. I don't wanna insist, but it seems like this could be a major pain for me and people with similar setups. Just updating on my dev machine isn't gonna cut it. Gotta update our production machine too. |
@fresheneesz The current (latest) version of Node is 8.5.0, and the 6.11.3 is the officially recommended stable build. I would personally recommend 7.6.0+, though, because of the native |
@fresheneesz Ah, and seems also that the Have you considered using the |
@fresheneesz you can also try to switch from Uglify to a minifier that already supports ECMAScript6 syntax out of the box, like this one: |
@xpl Thanks for the suggestions. I got the Ok, I gave up on trying to add a babel step and instead wrote my own stringifier: https://github.com/fresheneesz/beautinator . |
Line 12,
zeroWidthCharacters,
is not inkey: value
format. What is supposed to be there?The text was updated successfully, but these errors were encountered: