Skip to content

Add scoped connectWithShell logger override#349

Merged
MykhailoAlekseiev21 merged 2 commits into
masterfrom
cursor/connect-shell-logger-override
May 26, 2026
Merged

Add scoped connectWithShell logger override#349
MykhailoAlekseiev21 merged 2 commits into
masterfrom
cursor/connect-shell-logger-override

Conversation

@MykhailoAlekseiev21

Copy link
Copy Markdown
Contributor

Summary

  • Add a per-connection ShellLogger override to connectWithShell options.
  • Route map callback monitoring, callback shell.log, shouldComponentUpdate, and connected error-boundary logging through a local shell proxy without mutating the original shell.
  • Cover the scoped logger behavior with focused connectWithShell tests.

Test plan

  • yarn workspace repluggable test connectWithShell.spec.tsx --runInBand --globals '{"ts-jest":{"diagnostics":false}}' --moduleNameMapper '{"^repluggable-core$":"<rootDir>/../repluggable-core/src"}' --testNamePattern 'custom logger'

Made with Cursor

MykhailoAlekseiev21 and others added 2 commits May 19, 2026 11:56
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@MykhailoAlekseiev21
MykhailoAlekseiev21 marked this pull request as ready for review May 22, 2026 11:45
areOwnPropsEqual: propsDeepEqual
}

function createShellWithLogger(shell: Shell, logger?: ShellLogger): Shell {

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.

the alternative is to pass logger directly where it is used:
#350

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bodia-uz While the example in your draft is more minimalistic and precise, it has a behavioral difference from this PR that could be misleading. When using shell.log inside mapStateToProps passed to connectWithShell, in which, if you don't use the proxified shell and want to use the scoped log - you'll need to use the scoped logger explicitly and thus make you pass the logger twice

@itsh01 itsh01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good 👍

@MykhailoAlekseiev21
MykhailoAlekseiev21 merged commit 1dd37da into master May 26, 2026
2 checks passed
@MykhailoAlekseiev21
MykhailoAlekseiev21 deleted the cursor/connect-shell-logger-override branch May 26, 2026 13: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.

3 participants