-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore: add a simple babel build step #327
Conversation
This works locally, but I'm not sure why Travis CI doesn't find the babel modules. |
Aha! I tried using Is there some way to update NPM on Travis? v2 is rather outdated, as we're already on v4 which has lots of benefits. |
Oops, I had forgotten to use All green now! |
I tested in local webpack and browserify projects and it works in both. It just outputs UMD, which should basically work everywhere. |
I am not a big fan of this, but I guess it makes the code safer. I am worried that we will try to turn this into an es6 version and we will end up with two es6 versions of tween.js. Maybe I don't understand completely. Are we going to use anything other than "let" and "const" and maybe arrow functions? |
We will need a README update with new build instructions. |
IMO the best approach would be to have a single repo (this one), and make gradual changes to this repo towards ES6. We could take ideas from the es6-tween repo and apply them here over time, rather than having two repos (and two NPM packages), and rather than applying a huge mondo commit to this repo. Three.js doesn't have two repo or two NPM packages, for example. Thoughts on this idea? @mikebolt @d This pull request was the first, simplest change towards that direction, while keeping everything working. Let me add the README update. I think semantic-release runs the test script, and the test script happens to build everything first in order to test output files, so I.. think the workflow is exactly the same as before. Let's see what sole says. |
With that approach we would lose the ability to maintain an es5-only
version. There are still a few outstanding issues that I would like to
resolve.
…On Mon, Mar 20, 2017 at 7:39 PM Joseph Orbegoso Pea < ***@***.***> wrote:
IMO the best approach would be to have a single repo (this one), and make
gradual changes to this repo towards ES6. We could take ideas from the
es6-tween repo and apply them here over time, rather than having two repos
(and two NPM packages), and rather than applying a huge mondo commit to
this repo. Three.js doesn't have two repo or two NPM packages, for example.
Thoughts on this idea? @mikebolt <https://github.com/mikebolt> @d
<https://github.com/d>
This pull request was the first, simplest change towards that direction,
while keeping everything working.
Let me add the README update. I don't think build steps changed, I think
semantic-release runs the test script, and the test script happens to build
everything first in order to test output files, so I.. think the workflow
is exactly the same as before.
How can we verify this without publishing a new version to NPM?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#327 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACCavzXZimAHwOd-LlD61b6f2f7lMKCsks5rnzhfgaJpZM4Mh31M>
.
|
That's the whole point of this change. Do you really want to maintain different code bases of the same library? That doesn't seem ideal if it can be avoided. I wouldn't want to propose a change and then have to go write a second version of the change in for other code base; that doesn't sound as productive as having one code. We can maintain a single code base that is transpiled into |
Actually, unpkg.com already allows using NPM as a CDN, so we can add that to this README (like es6-tween has), and ES5 users can use that just fine. |
Plus if you look at Bublés output, it is much much more like ES5 than Babel, I think you'll like it... |
Notes:
var
s withlet
orconst
to show that it is transpiled.dist
folder.module.exports = TWEEN
.src/Tween.js
tosrc/TWEEN.js
because babel's UMD output automatically sets the global to be named after the file name, so a filename ofTween.js
means babel doesglobal.Tween = mod.exports
, while a filename ofTWEEN.js
makes babel doglobal.TWEEN = mod.exports
.test
script runs thebuild
script first, and runs unit tests againstdist/TWEEN.js
. jshint and jscs still run againstsrc/TWEEN.js
.This is a small step towards updating to a modern code base while still supporting older browsers.