Conversation
With these changes the size on disk is now |
platform/macos | ||
platform/qt | ||
platform/node/symbol-list | ||
platform/node/version-script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option I considered to reduce package size while avoiding having to declare all these things is to move the package.json
into platform/node/
and do the packaging from there. But that would be more distruptive of a change, so I did not take that route.
Also, I wish there was such a thing as .npminclude
but it does not exist: npm/npm#13171
@@ -49,7 +49,7 @@ | |||
"node": ">=6" | |||
}, | |||
"scripts": { | |||
"install": "node-pre-gyp install --fallback-to-build=false || make node", | |||
"install": "node-pre-gyp install --fallback-to-build=false", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change means that npm install
will still work and fetch a binary. But if a binary is not found the install will exit instead of calling make node
.
|
||
To create an Xcode project and use a GUI debugger in the case of a crash, run `make xnode`. | ||
```bash | ||
make node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that make xnode
does not exist anymore so I removed reference to it. Not sure when the xnode
target was removed /cc @friedbunny @tmpsantos
|
||
``` | ||
npm run test-suite | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this since i can't find any sign of its existence anymore
@@ -9,7 +9,7 @@ Requires a modern C++ runtime that supports C++14. | |||
By default, installs binaries. On these platforms no additional dependencies are needed. | |||
|
|||
- 64 bit macOS or 64 bit Linux | |||
- Node.js v4.x _(note: v5+ is known to have issues)_ | |||
- Node.js v10.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are only supporting + building with node v10 currently, so this drifted out of date
👋 @brendan-ward @petrsloup @klokan - I noticed you are maintainers of modules that depend on
Let me know if you have any concerns. |
@springmeyer thanks for reaching out! I believe that we will be fine with just binary versions; I was only relying on building from source until the binaries became consistently available (~4.0?). I 👍 the idea of reducing the package size as we go to some lengths in our Dockerfile to reduce some of these build dependencies. The only place where I've been trying to build from source is in trying to setup a new So - I think your assumptions above are valid for our use case. |
Great, thanks so much for the confirmation + feedback @brendan-ward. I'm also interested in |
@springmeyer Thanks for letting us know! We don't have any issue with this change -- we usually use mapbox-gl-native in a controlled docker environment (debian-based) and the prebuilt binaries are just fine. |
@petrsloup excellent, thanks for confirming. That's a relief. Glad to know that the pre-built binaries work well in the docker setup too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for putting to this together @springmeyer
Put back node-pre-gyp and node-pre-gyp-github to allow binaries to continue to be supported. if node-pre-gyp is not able to find a binary, cmake-js is run as a fallback. this somewhat relates to mapbox/mapbox-gl-native#15748 , where support for building was removed
Currently the node bindings include, in the package.json, a fallback to source compiles:
mapbox-gl-native/package.json
Line 52 in daf8e12
This is non-desirable for 3 reasons:
npm install
expect a binary and don't likely have the correct development environment to source compile. So in the rare circumstances where this fallback is triggered we should fail fast rather than try to fallback.@mapbox/mapbox-gl-native
on npm is 244 MB on disk due to the large./vendor
folder (`166 MB itself)So, my proposal is to:
npm install
will only get a binary, if availablemake node
.npmignore
to radically trim the size of the uploaded package on npm/cc @mapbox/gl-native @mapbox/static-apis @kkaefer