-
Notifications
You must be signed in to change notification settings - Fork 188
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
fix(compass-shell): Don't lose the isOperationInProgress state when the user switches tabs, bump mongosh to 2.3.6 COMPASS-8576 COMPASS-8689 #6538
Conversation
@@ -57,6 +57,12 @@ module.exports = (_env, args) => { | |||
}, | |||
}; | |||
|
|||
const snapshot = { | |||
unmanagedPaths: [ | |||
path.resolve('..', '..', 'node_modules', '@mongosh', 'browser-repl'), |
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.
This is useful in combination with packages/browser-repl/scripts/sync-to-compass.js
added to mongosh here.
packages/compass-shell/src/components/compass-shell/tab-compass-shell.tsx
Outdated
Show resolved
Hide resolved
initialInput, | ||
}) => { | ||
const initialEvaluate = useInitialEval(_initialEvaluate); | ||
|
||
const [isOperationInProgress, setIsOperationInProgress] = useTabState( |
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.
It would probably be nice to have this boolean even higher up so we can change the icon in the tab itself. That way you can see if the operation finishes while you're on a different tab, but that's probably a job for a different ticket.
@@ -8560,231 +8560,6 @@ | |||
"resolved": "configs/webpack-config-compass", | |||
"link": true | |||
}, | |||
"node_modules/@mongosh/arg-parser": { |
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 don't know why, but this is once again un-hoisting the shell dependencies for some reason.
So normally I just do
npm i mongodb@latest @mongosh/logging@latest @mongosh/node-runtime-worker-thread@latest @mongosh/browser-repl@latest bson@latest @mongodb-js/devtools-connect@latest @mongodb-js/devtools-proxy-support@latest && git checkout -- package.json && npm i
now
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.
Thanks! I didn't even notice that. Trying again..
const shellRef: ShellRef = useRef(null); | ||
const canRenderShell = !!(enableShell && initialHistory && runtime); | ||
|
||
// initialEvaluate will only be set on the first render |
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.
Nit: now that it's not tied to the React lifecycle of the browser-repl component, I'd maybe clarify that this is specifically a first render of the broser-repl Shell, not this component first render
See also mongodb-js/mongosh#2284
To test this, the easiest one is to connect to our analytics-node-test cluster, then in a shell:
Then switch to another tab like Welcome, then switch back to the shell tab.
Note: This also bumps mongosh to 2.3.6.