Migrate to ES6, use Rollup to build for Node #4652

Closed
nolanlawson opened this Issue Dec 13, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@nolanlawson
Member

nolanlawson commented Dec 13, 2015

See #4452 (comment) for why I want to do this.

Basically our structure would be as follows:

src/
lib/
dist/

src will be the ES6 source. lib will be the ES5, as output in one gigantic index.js by Rollup. dist will be the browser builds.

In our package.json, we'll have an esnext:main pointing to src and a main pointing to lib, so Node users will typically get lib, but ES6 module bundlers will know to use esnext:main.

Browserify will simply build as normal, using lib as its source and dist as its output.

For our officially supported extras API, we will have to build that separately and include it in lib, but it should be fairly easy. One additional benefit is that anything not in the extras will immediately stop working. So e.g. if you are being naughty and trying to use private methods, such as require('pouchdb/lib/utils/private-thingie'), it will stop working.

This has the potential to break some of our naughty consumers (I know both Hoodie and my plugins have abused PouchDB.utils in the past), so we may want to consider it a breaking change.

nolanlawson added a commit that referenced this issue Dec 27, 2015

nolanlawson added a commit that referenced this issue Dec 27, 2015

nolanlawson added a commit that referenced this issue Jan 1, 2016

@nolanlawson

This comment has been minimized.

Show comment
Hide comment
@nolanlawson

nolanlawson Jan 1, 2016

Member

fixed by #4710

Member

nolanlawson commented Jan 1, 2016

fixed by #4710

@nolanlawson nolanlawson closed this Jan 1, 2016

@reconbot

This comment has been minimized.

Show comment
Hide comment
@reconbot

reconbot Jan 13, 2016

Contributor

👏 👏 🌟 👍

Contributor

reconbot commented Jan 13, 2016

👏 👏 🌟 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment