static-dev / spike-core

:warning: UNMAINTAINED :warning: A modern static build tool, powered by webpack
https://spike.js.org
Other
58 stars 9 forks source link

`project.compile` should return an object instead of an array #148

Closed jescalan closed 8 years ago

jescalan commented 8 years ago

Right now, project.compile() returns an array containing the webpack compiler and a uuid associated with its particular compile run, so it can be associated with the event return if multiple compiles happen quickly. The compile event, however, returns an object like { id: 'xxx', stats: {} }.

The original reason for returning the array was that it could be cleanly destructured, but it's just as easy to destructure an object, and a more clear output when not destructured, so I think we should switch over. This would be a breaking change, but mostly for tests that directly utilize spike-core at this point, the cli could be smoothly upgraded without any notice to users.