Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We're browserifying the entire package.json #1842

Closed
nolanlawson opened this issue Apr 6, 2014 · 5 comments
Closed

We're browserifying the entire package.json #1842

nolanlawson opened this issue Apr 6, 2014 · 5 comments

Comments

@nolanlawson
Copy link
Member

This feels like a waste, if we really only need the package.version.

E.g. scroll down to the bottom of this release: http://cdn.jsdelivr.net/pouchdb/2.1.2/pouchdb.min.js

@daleharvey
Copy link
Member

due to version.js, we could change version.js to be modules.exports = 2.1.0 and do package.json et al as a build step? getting close to a microoptimisation (> 2K) that increases complexity, so 50/50 on it

@calvinmetcalf
Copy link
Member

so the other option is to change version.js every time we update the package.json, or possibly just when we build, bear in mind that we need to make sure its accurate in node and for custom builds.

Of the various options, this one is

  • most reliable (it's impossible for it to be incorrect)
  • simplest

but on the other hand it does add some junk, we'd need to fix this with a very elegant/simple solution if we can think of one.

@nolanlawson
Copy link
Member Author

All right, I think I came up with a decent solution. Just swap out version.js with

module.exports = "2.2.0-alpha";

when browserifying.

@nolanlawson
Copy link
Member Author

Reduces the gzipped file size from 34.3KB to 33.6KB. Not huge, but still useful given we claim 25KB on our web site, and we've ballooned since then.

calvinmetcalf added a commit that referenced this issue Apr 9, 2014
calvinmetcalf added a commit that referenced this issue Apr 10, 2014
calvinmetcalf added a commit that referenced this issue Apr 10, 2014
calvinmetcalf added a commit that referenced this issue Apr 10, 2014
@daleharvey
Copy link
Member

cb10037

sygi pushed a commit to sygi/pouchdb that referenced this issue Apr 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants