Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add proxy provider decorator for storybook#18023

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/refactor-storybook-decorator
May 27, 2025

Conversation

BrunoQuaresma
Copy link
Collaborator

No description provided.

@BrunoQuaresmaBrunoQuaresma requested a review froma teamMay 24, 2025 19:25
@BrunoQuaresmaBrunoQuaresma self-assigned thisMay 24, 2025
@BrunoQuaresmaBrunoQuaresma requested review fromParkreiner and removed request fora teamMay 24, 2025 19:25
@BrunoQuaresmaBrunoQuaresma merged commitafaa20e intomainMay 27, 2025
35 checks passed
@BrunoQuaresmaBrunoQuaresma deleted the bq/refactor-storybook-decorator branchMay 27, 2025 01:39
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 27, 2025
@@ -155,3 +161,30 @@ export const withOrganizationSettingsProvider = (Story: FC) => {
</OrganizationSettingsContext.Provider>
);
};

export const withProxyProvider =
(value?: Partial<ProxyContextValue>) => (Story: FC) => {
Copy link
Member

@ParkreinerParkreinerMay 27, 2025
edited
Loading

Choose a reason for hiding this comment

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

Oh, there might be a slight bug risk here. TypeScript'sPartial type not only makes the keys for an object optional, but also the values for each key. So someone could accidentally do this:

// Every single property in the value input can be set to undefinedwithProxyProvider({setProxy:undefined})

Obviously not a huge deal when you're placing literal values, but if we have any derived values that could be optionally undefined, having the...value at the end would mean that some fields would get wiped when we don't want them to be

Especially because this is a test utility that's used throughout several other files, I'd rather we go through the trouble of stitching the objects together manually, so that we have more peace of mind

Copy link
Member

Choose a reason for hiding this comment

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

If you're okay with it, I can make a quick patch PR

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Hm.. I see. Feel free to patch 🙏

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

@ParkreinerParkreinerParkreiner left review comments

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@BrunoQuaresma@kylecarbs@Parkreiner

[8]ページ先頭

©2009-2025 Movatter.jp