question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor into an npm package, serverless-plugin, and provide example handlers as individual Serverless functions

See original GitHub issue

It seems to make a lot of sense to turn serverless-chrome into an npm package, and separate Serverless plugin.

The plugin would hook into the Serverless after:createDeploymentArtifacts life cycle event and wrap around the handler function. The wrapper would then make sure that headless Chrome is running before calling the wrapped handler function.

https://serverless.com/framework/docs/providers/aws/guide/plugins/

  1. update for nodejs v6.10 (and remove Buffer.from hack/polyfill)
  2. refactor chrome bundle and chrome spawning into an npm package (npm: lambda-chrome ?)
  3. Serverless plugin, using npm package
  4. use Rollup(docs) for npm packages
  5. remove serverless-webpack plugin dependency
  6. create Serverless functions for each example handler
  7. ~change postinstall script to create serverless.yml instead of config.js from one of the example serverless.yml files~
  8. update all the documentation

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jgollub1commented, Nov 19, 2018

Hi, thanks for all the work you’ve done! I was wondering if anyone could direct me to a web-scraping example (eg just rendering the DOM and returning it) of serverless-chrome that is deployable to aws lambda? I’ve been tinkering around with your package for a little while but haven’t had much luck

1reaction
chriszaratecommented, Jun 9, 2017

@adieuadieu That’s it! ClaudiaJS, by default, uploads the payload directly. However, it provides an option to upload via S3. Testing again, I was able to upload a larger payload:

claudia create --use-s3-bucket my-bucket --handler index.handler

Since your npm package includes the uncompressed binary, Claudia will in effect require the use of the --use-s3-bucket to successfully upload. That’s a small price to pay for the resulting increase in spin-up speed, however.

I’ll put together a PR with a Claudia example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless Plugin Include Dependencies
This is a Serverless plugin that should make your deployed functions smaller. ... then individually adds each module file that your handler depends...
Read more >
Lambda in TypeScript with Serverless Framework - Codetain
Today I'd like to show you how to create your own lambda function in typescript. To achieve this I'll use the serverless framework...
Read more >
GitHub - juanjoDiaz/serverless-plugin-warmup
WarmUp solves cold starts by creating a scheduled lambda (the warmer) that invokes all the selected service's lambdas in a configured time interval...
Read more >
AWS Serverless Development: Coding Best Practices
Use webpack to improve cold start and reduce package size. For Node.js functions, the Initialization time is a big part of the cold...
Read more >
Serverless Node.js code with Azure Functions - Microsoft Learn
Azure Functions provides serverless code infrastructure, allowing you to create responsive, on-demand HTTP endpoints.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found