People
Repo info
✛ Add
See All
(466 members hidden)
ACTIVITY
caspervonb
4 hours ago
well, you got the github org so thats cool :)
mirek
4 hours ago

Hi everybody. Require'ing es6 npm doesn't seem to work for me.
I've released es6 package.
I'm npm install ...ing it but when I try to require it I get:

$ 6to5-node foo.js

SyntaxError: Unexpected reserved word on "import" keyword of that library.

Basically it's not treated as es6.

If I require it directly via ".../my-package/..." it works fine.

Is this a bug or expected behaviour?

sebmck
4 hours ago
@mirek files inside of node_modules are ignored
mirek
4 hours ago

To simplify the case:

// ./node_modules/foo.js
let a = "ok"
console.log(a)

// ./foo.js
let a = "ok"
console.log(a)

// test.js
import foo from "./foo" // works fine
import foo from "./node_modules/foo" // doesn't work

mirek
4 hours ago
exactly
sebmck
4 hours ago
yes, that’s expected behaviour
mirek
4 hours ago
it means you can't really distribute es6 npms then, no?
sebmck
4 hours ago
you should be compiling your code before npm distribution
mirek
4 hours ago
i do it but i thought i can give alternative "/6to5" entrypoint for compiled version and still use es6 one directly.
mirek
4 hours ago
thanks for clarifying will change it.
mirek
4 hours ago
Doesn't it mean that releasing npm like this locks all users of that library into 6to5? They can't really use other ES6 runtime providers?
sebmck
4 hours ago
no?
sebmck
4 hours ago
it just means you have to transpile your code before you distribute it
mirek
4 hours ago

one of the first lines in transpiled looks like this for example:

var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };

aren't things like __esModule 6to5 specific?

sebmck
4 hours ago
that’s only for interop between 6to5 modules
sebmck
4 hours ago
__esModule is a thing used by esnext, traceur, systemjs etc
mirek
4 hours ago
ok, cool. released npm as you've said. i'll see if anybody complains. thanks for info.
jeffutter
4 hours ago
It looks like babelify requires babel but babel isn't in it's package.json ?
sebmck
4 hours ago
@jeffutter fixed
jeffutter
4 hours ago
Error: Cannot find module 'babel' .... at Object.<anonymous> (.../node_modules/babelify/index.js:3:15)
sebmck
4 hours ago
upgrade
sebmck
4 hours ago
sorry, in the process of migrating all the plugins
jeffutter
3 hours ago
that was fast :)
hawkrives
3 hours ago
Yes! Babel! Whoo! (Good luck, @sebmck.)
ckknight
2 hours ago
I'm happy you guys changed the name to babel. Seems more future-proof.
caspervonb
2 hours ago
babelify :+1:
sebmck
2 hours ago
@ckknight so am i!
sebmck
2 hours ago
it’s 3:35am and i need to get up at 8am
sebmck
2 hours ago
was not expecting to do all of this tonight
thejameskyle
2 hours ago
The lesson is that when @thejameskyle says the JavaScript community will jump the gun on a name change if you give them anything, @thejameskyle is right :P
sebmck
2 hours ago
i underestimated how much people care
caspervonb
2 hours ago
It's the internet.. :P
caspervonb
2 hours ago
FYI I don't care, just informing as im pretty sure you are a mac user :P
sebmck
2 hours ago
sure am
cgeorg
an hour ago
Is the only breaking change for 4.0 the name?
sebmck
an hour ago
@cgeorg only thing that’s changed is the name and i’ve renamed the "optional runtime" to "external helpers"
thejameskyle
an hour ago
@sebmck sign off, go to bed
sebmck
an hour ago
@thejameskyle omg ok mum
thejameskyle
an hour ago
we can't have you overdosing on caffeine pills
cgeorg
an hour ago
Thanks :)
sebmck
an hour ago
@thejameskyle i’ll overdose on whatever i like thank you very much
thejameskyle
an hour ago
well at least do it on something more fun :P
sebmck
an hour ago
i have a bunch of wizz fizz i could try and OD on
sebmck
an hour ago
oh wait, that’s australian
hawkrives
10 minutes ago
Is it babel or babblejs?
hawkrives
9 minutes ago
As in, for the babel-loader description, would it be “babel module loader for webpack”?
hawkrives
9 minutes ago
That sounds a bit weird...
hawkrives
9 minutes ago
oh, one other question
hawkrives
8 minutes ago
Should the various npm packages have the ‘babel’ keyword?