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

Laconia#48 - Ignore if callback is falsy #415

Closed
wants to merge 35 commits into from

Conversation

hugosenari
Copy link
Contributor

@hugosenari hugosenari commented Nov 21, 2019

Partially solves #48
Changes:

  1. Use return when callback is falsy;
  2. Introduce a configuration that we eventually deprecate i.e. LACONIA_NO_CALLBACK = true;

Things to do after that (for other PRs):

  1. Update documentation with LACONIA_NO_CALLBACK;
  2. Add warning for deprecations of callback usage;
  3. Rewrite batch to work without callback;
  4. Remove anything (configs, warning and callback).

Hugo Ribeiro added 2 commits November 21, 2019 15:23
… commit: use return when callback is falsy
… commit: Create another entrypoint (ie: @laconia/core/async)
@hugosenari hugosenari changed the title Laconia#48 - serverless-offline raises warning due to callback usage Laconia#48 - Create another entrypoint (ie: @laconia/core/async) Nov 22, 2019
Copy link
Collaborator

@ceilfors ceilfors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hugosenari. Thanks for this PR. I personally feel that it's quite difficult to ask our users to add more boilerplate code to get rid of the warnings.

The solution from @geoffdutton might work more seamlessly for our users if you want to fix this issue. Although bear in mind that it triggered test failures (I can't remember in detail now), which I have documented here. I suspect that it might just test configuration issue.

@hugosenari
Copy link
Contributor Author

hugosenari commented Nov 26, 2019

I know, I have another branch for @geoffdutton solution and found where is the fail point, but it breaks API.

Options:

  1. Update major version (accept the breaking changes);
    • We need rewrite laconia/batch to use Async/Iterator;
  2. Create another entrypoint (ie: @laconia/core/async);
    • Leaves laconia/batch using legancy api.

And is not just warnings, annoys me that I need set context.callbackWaitsForEmptyEventLoop to false because we are using callbacks, thats why I suggest that if we don't have callback, we don't use it. And since it will be a common pattern (unless we break api) create built-in boilerplate to do that. 😄

@hugosenari hugosenari changed the title Laconia#48 - Create another entrypoint (ie: @laconia/core/async) Laconia#48 - Ignore if callback is falsy Dec 3, 2019
dependabot-preview bot and others added 22 commits December 4, 2019 17:11
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.574.0 to 2.575.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.574.0...v2.575.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [coveralls](https://github.com/nickmerwin/node-coveralls) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/nickmerwin/node-coveralls/releases)
- [Commits](https://github.com/nickmerwin/node-coveralls/commits/3.0.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [serverless](https://github.com/serverless/serverless) from 1.57.0 to 1.58.0.
- [Release notes](https://github.com/serverless/serverless/releases)
- [Changelog](https://github.com/serverless/serverless/blob/master/CHANGELOG.md)
- [Commits](serverless/serverless@v1.57.0...v1.58.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [dynamodb-local](https://github.com/doapp-ryanp/dynamodb-local) from 0.0.30 to 0.0.31.
- [Release notes](https://github.com/doapp-ryanp/dynamodb-local/releases)
- [Commits](https://github.com/doapp-ryanp/dynamodb-local/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.575.0 to 2.576.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.575.0...v2.576.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [pino](https://github.com/pinojs/pino) from 5.13.6 to 5.14.0.
- [Release notes](https://github.com/pinojs/pino/releases)
- [Commits](pinojs/pino@v5.13.6...v5.14.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.576.0 to 2.577.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.576.0...v2.577.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.577.0 to 2.578.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.577.0...v2.578.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [eslint](https://github.com/eslint/eslint) from 6.6.0 to 6.7.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v6.6.0...v6.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.578.0 to 2.579.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.578.0...v2.579.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [coveralls](https://github.com/nickmerwin/node-coveralls) from 3.0.8 to 3.0.9.
- [Release notes](https://github.com/nickmerwin/node-coveralls/releases)
- [Commits](nickmerwin/node-coveralls@3.0.8...3.0.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.579.0 to 2.580.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.579.0...v2.580.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
dependabot-preview bot and others added 11 commits December 4, 2019 17:11
Bumps [eslint](https://github.com/eslint/eslint) from 6.7.1 to 6.7.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v6.7.1...v6.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.580.0 to 2.582.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.580.0...v2.582.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.582.0 to 2.584.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.582.0...v2.584.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [serverless-s3-sync](https://github.com/k1LoW/serverless-s3-sync) from 1.9.1 to 1.9.2.
- [Release notes](https://github.com/k1LoW/serverless-s3-sync/releases)
- [Commits](k1LoW/serverless-s3-sync@v1.9.1...v1.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
The parameter is being created in acceptance.spec.js because CloudFormation does not support SecretString creation, obviously due to security reason.
In our case, as this is not really a secret, it is safe for us to have the plain text secret in our test.

This closes nearst#418
… commit: ignore callback if user set LACONIA_NO_CALLBACK = "true"
@hugosenari hugosenari requested a review from ceilfors December 4, 2019 20:45
@hugosenari
Copy link
Contributor Author

Updates:

  • Removed: async wrapper
  • Introduce a configuration that we eventually deprecate i.e. LACONIA_NO_CALLBACK = true, as @ceilfors suggested.

@FrancoMeriles
Copy link

This will come out in the next release ?

@hugosenari
Copy link
Contributor Author

closing this in favor of: #511

@hugosenari hugosenari closed this Jan 20, 2020
@hugosenari hugosenari deleted the laconia#48 branch January 22, 2020 22:46
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

Successfully merging this pull request may close these issues.

4 participants