Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Fix babel build error, convert Poll class into a function#1594

Draft
JSReds wants to merge 1 commit into
masterfrom
fix-babel-error-build
Draft

Fix babel build error, convert Poll class into a function#1594
JSReds wants to merge 1 commit into
masterfrom
fix-babel-error-build

Conversation

@JSReds
Copy link
Copy Markdown
Contributor

@JSReds JSReds commented May 25, 2022

Change-type: patch
Signed-off-by: Andrea Rosci andrear@balena.io

This PR should resolve a babel build error:

ERROR in ./src/utils/poll.ts 42:16
Module parse failed: The keyword 'private' is reserved (42:16)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var DEFAULT_GRACE_RATIO = 0.33;
| export var Poll = /*#__PURE__*/function () {
>   function Poll(private fn, private interval, graceRatio, isTabActive) {
|     _classCallCheck(this, Poll);
|
 @ ./src/index.ts 58:0-48 58:0-48 58:0-48
 @ ./.storybook/preview.js
 @ ./.storybook/preview.js-generated-config-entry.js
 @ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js ./node_modules/@storybook/core-client/dist/esm/globals/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs/dist/esm/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js ./node_modules/@storybook/addon-measure/dist/esm/preset/preview.js-generated-other-entry.js ./node_modules/storybook-addon-outline/dist/esm/preset/addDecorator.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined

Contributor checklist
  • I have regenerated jest snapshots for any affected components with npm run generate-snapshots
Reviewer Guidelines
  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

Comment thread src/utils/poll.ts Outdated
Comment thread src/utils/poll.ts

export const createPoll = (
fn: (poll: Poll) => Promise<any>,
fn: () => Promise<any>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we do use this in the UI to check whether the poll is cancelled.
Or maybe we only do that for useRequest 🤔 ?

Comment thread src/utils/poll.ts Outdated
@JSReds JSReds marked this pull request as draft May 25, 2022 21:39
Change-type: patch
Signed-off-by: Andrea Rosci <andrear@balena.io>
@JSReds JSReds force-pushed the fix-babel-error-build branch from f7d6ec6 to 3fad43c Compare May 26, 2022 09:30
@JSReds
Copy link
Copy Markdown
Contributor Author

JSReds commented May 27, 2022

need discussion, the fix was released with #1595

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants