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

refactor: move isAction to compass-utils #6268

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

mabaasit
Copy link
Contributor

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

Comment on lines -1 to -2
export type { AmpersandMethodOptions } from './promisify-ampersand-method';
export { promisifyAmpersandMethod } from './promisify-ampersand-method';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

drive-by: we are not using these anywhere, so cleaned it up

[extraProps: string]: any;
}

export function isAction<A extends AnyAction>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

or should i rename it to isReduxAction?

): action is A {
return action.type === type;
}
import { throwIfAborted, isAction } from '@mongodb-js/compass-utils';
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a good thing to do in general (we should also consider moving some type helpers for redux in the same place), but compass-utils has a dependency on electron and by moving this very generic dependency here you are adding electron to a dependency chain of all plugins that will use it, so we should either have it exported under a different named export to separate the code by imports (this might be good to do for this async helpers anyway), have electron and electron/remote as optional peer deps instead of direct deps and account for this in code, have a completely separate package for these redux helpers

@mabaasit mabaasit marked this pull request as draft September 23, 2024 08:04
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.

2 participants