-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Bug: using MessageChannel prevents node.js process from exiting #20756
Comments
Nice find! Do you want to submit a PR to fix? |
I would love to help you on fixing this problem.Can you guide me in submitting a fix? I am really new to open source. @rickhanlonii |
@rickhanlonii |
Issue example: var { JSDOM } = require('jsdom')
var { window } = new JSDOM()
global.window = window
global.document = window.document
require('scheduler') |
Hey all, anyone can take this issue, I'll review the first PR. The problem is that this feature detection is too naive. In node environments, we should use |
We're going with #20834 as a likely fix in 17.1.0, but it will need more testing. |
How to fix thisIf you can upgrade to React 17.1.0When React 17.1.0 comes out, it will contain a fix for this. So upgrading would solve this problem. (At the time this comment is written, it's not out yet, but I expect it to be out soon.) If you can't upgrade to React 17.1.0
and add this to your test setup file as THE VERY FIRST IMPORT: import 'react-16-node-hanging-test-fix';
// All other imports go after it:
import React from 'react'
// ... (For example, Create React App projects use This should fix the hanging on Node 15+ with jsdom on older versions of React. We don't plan to be updating them because there's too much risk of breaking something else, as this detection is subtle and there are many possible edge cases. The package with the fix will print a warning asking you to remove it after you upgrade to React 17.1.0. This is because the fix itself is to disable Node's Let me know if you run into more problems! I'll keep the issue for now until we release 17.1.0. |
Brilliant fix :)
Would it make sense to let Node.js devs know that this is happening? Perhaps, they could consider undoing the change in Node 16. |
I've briefly chatted with Node folks but it seems pretty difficult to change (and would be a breaking change). In our case, |
* pkg: update dependencies webpack/babel/electron * webpack: update configs to migrate to webpack 5 * pkg: update babel config for updated electron * app: stub globalThis for global * sentry: bypass check for isPackaged in renderer: electron / remote * app: replace electron.remote with updated @electron/remote * deps: update sentry * build: replace loaders in webpack configs * ci: update to node 16 * tests: webpack config and react bug More info: facebook/react#20756 (comment) * ci: add windows build and package * util: replace nameChecker with hsd rules module * pkg: document mac arm64 and update package.json scripts * docs: update BUILD.md with new mac package cmd * pkg: move `react-16-node-hanging-test-fix` to devDep * pkg: update non-breaking deps * sentry: load sentry and app based on process Co-authored-by: Rithvik Vibhu <rithvikvibhu@gmail.com>
@gaearon -- I think the
Shouldn't the Right now it's evaluating "greater than 17.0.1" -- so I'm getting the warning for |
@jarredt what version of |
@rickhanlonii -- ah, so we're using |
@jarredt did you manage to get around this issue? We are facing the same problem. |
For now I've just kept using the temp fix package but patched it to adjust
the version on which it applies the warning. I'm hoping we can update
storybook soon and so won't need to make any adjustments after that.
…On Fri, Sep 9, 2022, 7:12 AM Andre Rosa ***@***.***> wrote:
@jarredt <https://github.com/jarredt> did you manage to get around this
issue? We are facing the same problem.
—
Reply to this email directly, view it on GitHub
<#20756 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7LLP5KECNACCBT4WADX6DV5NATTANCNFSM4XHPUFZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
## Summary - Renamed all tests with their respective TypeScript counterparts. - Fixed jestUtils to properly allow strict checking of AnimatedStyle. - Added type declaration emitting to plugin. - Moved building plugin files before running TypeScript on the project (otherwise TypeScript tests would fail during type-checking). - Added test for jestUtils. - Bumped `jest` version and added `@types/react-test-renderer`. --- Added to `jest-setup.js`: ```diff + delete global.MessageChannel; ``` This line is coming from `react-16-node-hanging-test-fix`. It fixes an error of open handles in `@testing-library/react-native` function `render` and jest going 😵. [Reference](facebook/react#20756). ## Test plan `yarn && yarn jest --detectOpenHandles` ftw
This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests. Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript. There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18.
## Summary - Renamed all tests with their respective TypeScript counterparts. - Fixed jestUtils to properly allow strict checking of AnimatedStyle. - Added type declaration emitting to plugin. - Moved building plugin files before running TypeScript on the project (otherwise TypeScript tests would fail during type-checking). - Added test for jestUtils. - Bumped `jest` version and added `@types/react-test-renderer`. --- Added to `jest-setup.js`: ```diff + delete global.MessageChannel; ``` This line is coming from `react-16-node-hanging-test-fix`. It fixes an error of open handles in `@testing-library/react-native` function `render` and jest going 😵. [Reference](facebook/react#20756). ## Test plan `yarn && yarn jest --detectOpenHandles` ftw
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (#6623) This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer. Most of the changes are import path changes. Some of the more notable changes to look through are How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos). a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True. b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config. The actual index.ts that is added to frontend/lib Some things to note that will be punt down but worked on later: We also need to look into why protobuf can't be compiled through tsc. Cleaning frontend/app/package.json Cleaning frontend/app/yarn.lock Cleaning frontend/lib/scripts/create.js Determine what's going wrong with globalStyles typing Determine what's going wrong with styled-components typing for EmotionTheme * Change exports for protobuf to be included in index.ts instead of copied through cp command. (#6635) Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense. The reason why I did that was because I was getting an error on first try: `src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal"; ~~~~~~ src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal";` I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should. * Simple fix for globalStyles (#6651) * Fix typing issues for styled-components (#6652) There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense. * remove extra app directory in frontend dir (#6653) The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory. This PR also fixes the audit_license script. * Remove unnecessary files * Fix naming of directories and files * Fix BaseColorPicker directory * Add Fixes that should exist in feature/st-lib * Fix Eslint and Type-checking for st-lib (#6675) This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts. In addition, this PR fixes the type checking github actions by adding new commands. * Fix notices (#6676) * Clean up audit_frontend_licenses * Fix/yarn test (#6681) This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests. Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript. There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18. * Fix regex that I accidentally forgot to commit (#6698) * Fix/cypress (#6699) * Remove unused app dep / dev dep and declarations.d.ts (#6713) * Remove unused app dep / dev dep and declarations.d.ts * Remove d3 color resolution (#6714) * Add dependencies removed from app to lib/package.json * Add pbjs cli * Readd notices * Add watch lib script (#6730) Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change. Will also need to update the contributing wiki after this is merged to develop. * Get rid of yarn start warnings and clean Makefile (#6739) * Remove streamlit.css. I'm not sure where it came from * Fix yarn buildLib * Fix eslintrc * Fix codeql * Add notices and yarn.lock * Fix glide-data-grid versions * Fix nits * Fix nits * Lint and cleanup * Minor cleanup for Block utils as comments got removed * Remove accidentally committed file * Revert "Remove accidentally committed file" This reverts commit 87b7f13. * Fix yarn lock * Fix compilation errors * Fix lint * Fix notices * Remove unnecessary package.json dependencies * Fix package.json versions * Fix yarn.lock and streamlit dialog snapshots * Fix notices * Have faster hot reloading and absolute imports for @streamlit/lib (#6961) <!--⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES! https://github.com/streamlit/streamlit/wiki/Contributing --> ## Describe your changes - Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. - Change imports for `lib` to absolute imports - add `tsconfig.dev.json` that is specifically for developement - change `tsconfig.json` for `lib` and `app` - change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project ## GitHub Issue Link (if applicable) ## Testing Plan Manually testing - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? yes https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7 --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. * Fix minor comments from Lukas
We have a lot of open handles flooding the end of our test results. It seems that they are due to a React issue fixed in 18+. Dan Abramov wrote a small package to fix the issue temporarly. I added it here manually because it has an error in the semver version check. This code should be removed when upgrading React to 18+. facebook/react#20756 (comment)
We have a lot of open handles flooding the end of our test results. It seems that they are due to a React issue fixed in 18+. Dan Abramov wrote a small package to fix the issue temporarly. I added it here manually because it has an error in the semver version check. This code should be removed when upgrading React to 18+. facebook/react#20756 (comment)
We have a lot of open handles flooding the end of our test results. It seems that they are due to a React issue fixed in 18+. Dan Abramov wrote a small package to fix the issue temporarly. I added it here manually because it has an error in the semver version check. This code should be removed when upgrading React to 18+. facebook/react#20756 (comment)
We have a lot of open handles flooding the end of our test results. It seems that they are due to a React issue fixed in 18+. Dan Abramov wrote a small package to fix the issue temporarly. I added it here manually because it has an error in the semver version check. This code should be removed when upgrading React to 18+. facebook/react#20756 (comment)
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623) This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer. Most of the changes are import path changes. Some of the more notable changes to look through are How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos). a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True. b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config. The actual index.ts that is added to frontend/lib Some things to note that will be punt down but worked on later: We also need to look into why protobuf can't be compiled through tsc. Cleaning frontend/app/package.json Cleaning frontend/app/yarn.lock Cleaning frontend/lib/scripts/create.js Determine what's going wrong with globalStyles typing Determine what's going wrong with styled-components typing for EmotionTheme * Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635) Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense. The reason why I did that was because I was getting an error on first try: `src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal"; ~~~~~~ src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal";` I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should. * Simple fix for globalStyles (streamlit#6651) * Fix typing issues for styled-components (streamlit#6652) There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense. * remove extra app directory in frontend dir (streamlit#6653) The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory. This PR also fixes the audit_license script. * Remove unnecessary files * Fix naming of directories and files * Fix BaseColorPicker directory * Add Fixes that should exist in feature/st-lib * Fix Eslint and Type-checking for st-lib (streamlit#6675) This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts. In addition, this PR fixes the type checking github actions by adding new commands. * Fix notices (streamlit#6676) * Clean up audit_frontend_licenses * Fix/yarn test (streamlit#6681) This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests. Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript. There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18. * Fix regex that I accidentally forgot to commit (streamlit#6698) * Fix/cypress (streamlit#6699) * Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713) * Remove unused app dep / dev dep and declarations.d.ts * Remove d3 color resolution (streamlit#6714) * Add dependencies removed from app to lib/package.json * Add pbjs cli * Readd notices * Add watch lib script (streamlit#6730) Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change. Will also need to update the contributing wiki after this is merged to develop. * Get rid of yarn start warnings and clean Makefile (streamlit#6739) * Remove streamlit.css. I'm not sure where it came from * Fix yarn buildLib * Fix eslintrc * Fix codeql * Add notices and yarn.lock * Fix glide-data-grid versions * Fix nits * Fix nits * Lint and cleanup * Minor cleanup for Block utils as comments got removed * Remove accidentally committed file * Revert "Remove accidentally committed file" This reverts commit 87b7f13. * Fix yarn lock * Fix compilation errors * Fix lint * Fix notices * Remove unnecessary package.json dependencies * Fix package.json versions * Fix yarn.lock and streamlit dialog snapshots * Fix notices * Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961) <!--⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES! https://github.com/streamlit/streamlit/wiki/Contributing --> ## Describe your changes - Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. - Change imports for `lib` to absolute imports - add `tsconfig.dev.json` that is specifically for developement - change `tsconfig.json` for `lib` and `app` - change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project ## GitHub Issue Link (if applicable) ## Testing Plan Manually testing - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? yes https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7 --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. * Fix minor comments from Lukas
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623) This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer. Most of the changes are import path changes. Some of the more notable changes to look through are How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos). a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True. b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config. The actual index.ts that is added to frontend/lib Some things to note that will be punt down but worked on later: We also need to look into why protobuf can't be compiled through tsc. Cleaning frontend/app/package.json Cleaning frontend/app/yarn.lock Cleaning frontend/lib/scripts/create.js Determine what's going wrong with globalStyles typing Determine what's going wrong with styled-components typing for EmotionTheme * Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635) Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense. The reason why I did that was because I was getting an error on first try: `src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal"; ~~~~~~ src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal";` I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should. * Simple fix for globalStyles (streamlit#6651) * Fix typing issues for styled-components (streamlit#6652) There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense. * remove extra app directory in frontend dir (streamlit#6653) The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory. This PR also fixes the audit_license script. * Remove unnecessary files * Fix naming of directories and files * Fix BaseColorPicker directory * Add Fixes that should exist in feature/st-lib * Fix Eslint and Type-checking for st-lib (streamlit#6675) This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts. In addition, this PR fixes the type checking github actions by adding new commands. * Fix notices (streamlit#6676) * Clean up audit_frontend_licenses * Fix/yarn test (streamlit#6681) This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests. Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript. There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18. * Fix regex that I accidentally forgot to commit (streamlit#6698) * Fix/cypress (streamlit#6699) * Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713) * Remove unused app dep / dev dep and declarations.d.ts * Remove d3 color resolution (streamlit#6714) * Add dependencies removed from app to lib/package.json * Add pbjs cli * Readd notices * Add watch lib script (streamlit#6730) Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change. Will also need to update the contributing wiki after this is merged to develop. * Get rid of yarn start warnings and clean Makefile (streamlit#6739) * Remove streamlit.css. I'm not sure where it came from * Fix yarn buildLib * Fix eslintrc * Fix codeql * Add notices and yarn.lock * Fix glide-data-grid versions * Fix nits * Fix nits * Lint and cleanup * Minor cleanup for Block utils as comments got removed * Remove accidentally committed file * Revert "Remove accidentally committed file" This reverts commit 87b7f13. * Fix yarn lock * Fix compilation errors * Fix lint * Fix notices * Remove unnecessary package.json dependencies * Fix package.json versions * Fix yarn.lock and streamlit dialog snapshots * Fix notices * Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961) <!--⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES! https://github.com/streamlit/streamlit/wiki/Contributing --> ## Describe your changes - Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. - Change imports for `lib` to absolute imports - add `tsconfig.dev.json` that is specifically for developement - change `tsconfig.json` for `lib` and `app` - change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project ## GitHub Issue Link (if applicable) ## Testing Plan Manually testing - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? yes https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7 --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. * Fix minor comments from Lukas
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623) This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer. Most of the changes are import path changes. Some of the more notable changes to look through are How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos). a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True. b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config. The actual index.ts that is added to frontend/lib Some things to note that will be punt down but worked on later: We also need to look into why protobuf can't be compiled through tsc. Cleaning frontend/app/package.json Cleaning frontend/app/yarn.lock Cleaning frontend/lib/scripts/create.js Determine what's going wrong with globalStyles typing Determine what's going wrong with styled-components typing for EmotionTheme * Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635) Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense. The reason why I did that was because I was getting an error on first try: `src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal"; ~~~~~~ src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit. 4 import * as $protobuf from "protobufjs/minimal";` I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should. * Simple fix for globalStyles (streamlit#6651) * Fix typing issues for styled-components (streamlit#6652) There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense. * remove extra app directory in frontend dir (streamlit#6653) The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory. This PR also fixes the audit_license script. * Remove unnecessary files * Fix naming of directories and files * Fix BaseColorPicker directory * Add Fixes that should exist in feature/st-lib * Fix Eslint and Type-checking for st-lib (streamlit#6675) This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts. In addition, this PR fixes the type checking github actions by adding new commands. * Fix notices (streamlit#6676) * Clean up audit_frontend_licenses * Fix/yarn test (streamlit#6681) This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests. Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript. There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18. * Fix regex that I accidentally forgot to commit (streamlit#6698) * Fix/cypress (streamlit#6699) * Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713) * Remove unused app dep / dev dep and declarations.d.ts * Remove d3 color resolution (streamlit#6714) * Add dependencies removed from app to lib/package.json * Add pbjs cli * Readd notices * Add watch lib script (streamlit#6730) Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change. Will also need to update the contributing wiki after this is merged to develop. * Get rid of yarn start warnings and clean Makefile (streamlit#6739) * Remove streamlit.css. I'm not sure where it came from * Fix yarn buildLib * Fix eslintrc * Fix codeql * Add notices and yarn.lock * Fix glide-data-grid versions * Fix nits * Fix nits * Lint and cleanup * Minor cleanup for Block utils as comments got removed * Remove accidentally committed file * Revert "Remove accidentally committed file" This reverts commit 87b7f13. * Fix yarn lock * Fix compilation errors * Fix lint * Fix notices * Remove unnecessary package.json dependencies * Fix package.json versions * Fix yarn.lock and streamlit dialog snapshots * Fix notices * Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961) <!--⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES! https://github.com/streamlit/streamlit/wiki/Contributing --> ## Describe your changes - Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. - Change imports for `lib` to absolute imports - add `tsconfig.dev.json` that is specifically for developement - change `tsconfig.json` for `lib` and `app` - change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project ## GitHub Issue Link (if applicable) ## Testing Plan Manually testing - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? yes https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7 --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. * Fix minor comments from Lukas
Edited: Here's how to fix this: #20756 (comment).
React version: 17.0.1 (latest)
Steps To Reproduce
This code finishes properly in node.js 14, but holds the process open in node.js 15
Since node.js 15, there is a global
MessageChannel
object now, which prevents node event loop from exiting. To let the process shut down properly, it should either callport.close()
orport.unref()
This becomes an issue when testing React code within JSDOM environment, as the test process cannot exit properly.
The current behavior
The process with JSDOM tests never finishes
The expected behavior
The process finishes properly
The text was updated successfully, but these errors were encountered: