brackets-userland / brackets-npm-registry

Extension to install other extensions with npm
MIT License
44 stars 8 forks source link

Linux brackets shell doesn't support generators? #2

Closed mackenza closed 9 years ago

mackenza commented 9 years ago

carrying on from https://groups.google.com/forum/?nomobile=true#!topic/brackets-dev/lxMADzwDoWk

I found in the gulpfile.js that you are excepting generators from babel:

// options for transpiling es6 to es5
var babelOptions = {
  // generators are available in Brackets' shell and also break sourcemaps
  blacklist: ['regenerator', 'strict']
};

yet on Linux, where I am trying to run this, the function* is causing an error unexpected token which leads me to believe that perhaps the version of CFE that Linux uses may not support generators? (it's just a guess at this point)

mackenza commented 9 years ago

I changed the blacklist to the following:

// options for transpiling es6 to es5
var babelOptions = {
  // generators are available in Brackets' shell and also break sourcemaps
  blacklist: [] // ['regenerator', 'strict']
};

and I get past the above error. Now I get an error: Extension] failed to load /home/mackenza/.config/Brackets/extensions/user/brackets-npm-registry - ReferenceError: regeneratorRuntime is not defined

still plugging away ;)

mackenza commented 9 years ago

So I entered navigator.userAgent in the Brackets devTools and got:

"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.80 Safari/537.36" so it appears that Linux, at least, is running Chrome 29.x and therefore doesn't support Javascript generators, which according to MDN are in 39 and later.

mackenza commented 9 years ago

https://groups.google.com/forum/m/#!topic/brackets-dev/0dXM-I3CzRk I am wondering with the shift of resources from adobe for this project if this will get addressed any time soon? It's already 4 months old :(

zaggino commented 9 years ago

This is an easy fix for linux, I totally forgot about the generators issue, I'll fix this as soon as I get to work. No worries.

zaggino commented 9 years ago

@mackenza can you test now please? see my latest commit for this issue

mackenza commented 9 years ago

it worked, I think. I installed your ES6 Hello World extension, but I am not quite sure what it's supposed to do ;)

zaggino commented 9 years ago

es6-hello-world does exactly what it says it does, logs hello-world to the console :smile:

what matters is a proof of concept here, you can install a thing from npm, get dependencies downloaded, get gulp tasks executed ... much better than with current brackets' inbuilt extension manager ... and you get the stability of npm too

mackenza commented 9 years ago

Do you get "no linter for javascript" on the files in your repo? (in Brackets that is)

mackenza commented 9 years ago

the same changes would need to be made to es6 hello world as I get a generator error again.

zaggino commented 9 years ago

this repo uses eslint for linting, it's configured in .brackets.json file you can install eslint through this extension, latest version is in the npm

zaggino commented 9 years ago

yeah, I'm already updating es6-hello-world with these changes https://github.com/zaggino/brackets-es6-hello-world/commit/9f0d91df973ce5f860b93f8323811153cd4d6373