mattdesl / budo

:clapper: a dev server for rapid prototyping
MIT License
2.17k stars 106 forks source link

Upgrade browserify #203

Closed wwwtyro closed 7 years ago

wwwtyro commented 7 years ago

Would love to pull this in: https://github.com/substack/node-browserify/issues/1667

(sorry, wrong link previously)

mattdesl commented 7 years ago

Ok, I think I'll treat it as a major release of budo since browserify@14 is dropping support for old IE in the Buffer module (a breaking change). I plan on making a major bump of budo anyways for the LiveReload integration, which is pretty much complete except for some documentation.

For now you can take advantage of the latest browserify (as well as new LiveReload backend) via:

npm i mattdesl/budo#feature/livereload-rework --save-dev
timwis commented 7 years ago

Hm, that command does seem to install browserify 14.1, but I'm still getting Unexpected token while parsing file on the line that has async on it. Is there some other parser that budo uses? Or have I just not had enough coffee yet?

Edit: Perhaps it's that thing that pretty-prints errors in the browser, pointing to the exact code.

mattdesl commented 7 years ago

It seems to work fine for me. Maybe check the following:

Here's the code I'm testing:

function resolveAfter2Seconds(x) {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve(x);
    }, 2000);
  });
}

async function add1(x) {
  var a = resolveAfter2Seconds(20);
  var b = resolveAfter2Seconds(30);
  return x + await a + await b;
}

add1(10).then(v => {
  console.log(v);  // prints 60 after 2 seconds.
});

And the command I'm using:

budo index.js -o
timwis commented 7 years ago

Thanks - I disabled sheetify and it compiled, so I'll investigate sheetify

mattdesl commented 7 years ago

Going to close this for now since it no longer seems related to budo. Feel free to open a new issue if there's anything else. :smile:

timwis commented 7 years ago

Just to clarify, it looks like budo now uses browserify 14.1 per package.json. Thanks!