While this is not an issue of itself, the npm prepublish script doesn't include a transpiling step, meaning that these const keywords are still present in the compiled pjax.js build artifact.
To fix this and continue using ES6 syntax, the prepublish step could use Babel in conjunction with Browserify. Alternatively, the 3 instances of const in use could be replaced with var keywords.
It looks like some of the more recent changes to this library have introduced the use of the `const` keyword e.g. the in new `switchElementsAlt` method: https://github.com/MoOx/pjax/blob/b98e3ef9144553e3e8c70c82b04b5220f2dab589/lib/switches.js#L23
While this is not an issue of itself, the npm prepublish script doesn't include a transpiling step, meaning that these `const` keywords are still present in the compiled `pjax.js` build artifact.
To fix this and continue using ES6 syntax, the prepublish step could use Babel in conjunction with Browserify. Alternatively, the 3 instances of `const` in use could be replaced with `var` keywords.
You're right, that's a bug. While it would be great to use ES6, a big part of Pjax is being compatible with older browsers, and I don't think it's makes sense to add extra tooling at this point.
You can submit a PR, or I'll fix it when I have a chance.
You're right, that's a bug. While it would be great to use ES6, a big part of Pjax is being compatible with older browsers, and I don't think it's makes sense to add extra tooling at this point.
You can submit a PR, or I'll fix it when I have a chance.
@BehindTheMath I agree that it seems like a lot of effort to add extra tooling to transpile 3 keywords, so I will submit a PR for you. I'm currently using the library in a project I'm developing and was very pleased to see your efforts in working towards pushing out a new version on npm -- I'm very happy to do anything I can to help move that along 😄
@BehindTheMath I agree that it seems like a lot of effort to add extra tooling to transpile 3 keywords, so I will submit a PR for you. I'm currently using the library in a project I'm developing and was very pleased to see your efforts in working towards pushing out a new version on npm -- I'm very happy to do anything I can to help move that along 😄
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
It looks like some of the more recent changes to this library have introduced the use of the
constkeyword e.g. the in newswitchElementsAltmethod: https://github.com/MoOx/pjax/blob/b98e3ef9144553e3e8c70c82b04b5220f2dab589/lib/switches.js#L23While this is not an issue of itself, the npm prepublish script doesn't include a transpiling step, meaning that these
constkeywords are still present in the compiledpjax.jsbuild artifact.To fix this and continue using ES6 syntax, the prepublish step could use Babel in conjunction with Browserify. Alternatively, the 3 instances of
constin use could be replaced withvarkeywords.You're right, that's a bug. While it would be great to use ES6, a big part of Pjax is being compatible with older browsers, and I don't think it's makes sense to add extra tooling at this point.
You can submit a PR, or I'll fix it when I have a chance.
@BehindTheMath I agree that it seems like a lot of effort to add extra tooling to transpile 3 keywords, so I will submit a PR for you. I'm currently using the library in a project I'm developing and was very pleased to see your efforts in working towards pushing out a new version on npm -- I'm very happy to do anything I can to help move that along 😄