-
Notifications
You must be signed in to change notification settings - Fork 202
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
refactor: replace promises with async/await #496
Conversation
Codecov Report
@@ Coverage Diff @@
## master #496 +/- ##
==========================================
+ Coverage 62.50% 65.35% +2.85%
==========================================
Files 12 12
Lines 1696 1882 +186
Branches 279 341 +62
==========================================
+ Hits 1060 1230 +170
- Misses 636 652 +16
Continue to review full report at Codecov.
|
0445779
to
2d0c884
Compare
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.
I think the PR title
should start with BREAKING CHANGE:
to trigger a major release
https://github.com/semantic-release/semantic-release#commit-message-format
Would it make sense to add a migration section to the readme?
According to https://www.conventionalcommits.org/en/v1.0.0/ the breaking change section goes into the footer or you add the exclamation mark after the type. |
Not sure what to write in a migration section. In theory this does not need changes in the vast majority of setups unless maybe the whole babel and regenerator stuff needs to be added somewhere. I'm not very familiar with those. But overall the breaking changes are only in the validation of parameters for the sync calls from what I can tell, so you would probably only encounter those during development and not once things are fully set up. |
BREAKING CHANGE: Some functions that used to throw synchronously for things like bad parameters now reject the promise. In many cases users may not have to do anything assuming the calls already happened within a promise chain, but in rare cases this may need some refactoring of error handling cases.
2d0c884
to
0399242
Compare
🎉 This PR is included in version 8.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello contentful team! Question about this change: Previously, we were able to run contentful in Node (v12.3.1) without issue, and now the same script is throwing an error. I understand that this includes breaking changes, but what would you recommend as the course of action to resolve something like this? (node:72864) UnhandledPromiseRejectionWarning: ReferenceError: regeneratorRuntime is not defined
at Object._getEntries (/Users/mattduleone/sites/next-web/node_modules/contentful/dist/contentful.node.js:6213:51)
at Object.getEntries (/Users/mattduleone/sites/next-web/node_modules/contentful/dist/contentful.node.js:6191:24)
at fetchContentfulData (/Users/mattduleone/sites/next-web/bin/contentful-refresh.js:59:33)
at populateData (/Users/mattduleone/sites/next-web/bin/contentful-refresh.js:90:29)
at Object.<anonymous> (/Users/mattduleone/sites/next-web/bin/contentful-refresh.js:111:1)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) |
Oh that was definitely an unintended side effect of this change. |
@TimBeyer thank you! Testing this out now! |
@TimBeyer Everything is working as expected. Thank you again! |
Hi, also getting the same error as @mduleone ( I'm just passed fixing this error: And now trying to get a simple |
BREAKING CHANGE: Some functions that used to throw synchronously for things like bad parameters now reject the promise.
In many cases users may not have to do anything assuming the calls already happened within a promise chain, but in rare cases this may need some refactoring of error handling cases.