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

Node build without crypto or buffertools #332

Closed
SimonWoolf opened this issue Sep 12, 2016 · 5 comments
Closed

Node build without crypto or buffertools #332

SimonWoolf opened this issue Sep 12, 2016 · 5 comments
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@SimonWoolf
Copy link
Member

https://app.intercom.io/a/apps/ua39m1ld/inbox/all/conversations/5952016749 has made me wonder if we should offer a node package without cryptojs and buffertools (like ably.noencryption.js for the browser), for usecases like using on AWS Lambda, where large package sizes (npm package is > 10MB at the moment, mostly cryptojs)) and having natively compiled modules are a pain.

@SimonWoolf SimonWoolf added the enhancement New feature or improved functionality. label Sep 12, 2016
@mattheworiordan
Copy link
Member

You could take a similar approach to ably-ruby-rest where it simply references ably-js as a sub-module thus allowing it to skip all dependencies but use most of the code

@leozc
Copy link

leozc commented Oct 6, 2016

@mattheworiordan possible be more explicit ?
I have a node app that runs in AWS, and what exactly should be go into package.json and the import line?

Here is the error from AWS lambda

{
  "errorMessage": "Cannot find module './build/Debug/buffertools.node'",
  "errorType": "Error",
  "stackTrace": [
    "Function.Module._load (module.js:276:25)",
    "Module.require (module.js:353:17)",
    "require (internal/module.js:12:17)",
    "Object.<anonymous> (/var/task/node_modules/buffertools/buffertools.js:26:20)",
    "Module._compile (module.js:409:26)",
    "Object.Module._extensions..js (module.js:416:10)",
    "Module.load (module.js:343:32)",
    "Function.Module._load (module.js:300:12)",
    "Module.require (module.js:353:17)",
    "require (internal/module.js:12:17)"
  ]

@mattheworiordan
Copy link
Member

@leozc that note was for Simon to look at, probably not something we could easily explain how you can do it. Can you wait till early next week as we may be able to make a release that does not depend on buffertools?

@mattheworiordan
Copy link
Member

@SimonWoolf we need to look at this on Monday as @paddybyers has confirmed Buffertools is not needed (Node.js 4.3.2 on Lambda has Buffer support, it was introduced in 0.11!).

Also, it seems crypto is part of Node.js core so shouldn't be an issue.

We need to remove BufferTools and check that it works in Lambda, then bump a release and add a note that we no longer support Node < 0.11

@SimonWoolf
Copy link
Member Author

Fixed by #340, released as part of ably-js 0.8.38.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

3 participants