Skip to content

Conversation

evanpurkhiser
Copy link
Member

@evanpurkhiser evanpurkhiser commented Jul 25, 2023

This change simplifies the PlatformRegistry in various ways. I will leave inline comments on the PR.

@vercel
Copy link

vercel bot commented Jul 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 0:43am

@evanpurkhiser evanpurkhiser requested review from a team July 25, 2023 18:21
}
`;

export const formatCaseStyle = (style: string, value: string): string => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't make sense for this to be exported in usePlatforms.

// community,
// }

export type Guide = {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to a types file

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-platforms-improve-implementation-of-platformregistry branch 2 times, most recently from c904066 to b5271ee Compare July 25, 2023 18:45
// platform might actually not be a platform, so lets handle that case gracefully
if (!(currentPlatform as Platform).guides) {

if (currentPlatform.type === 'guide') {
Copy link
Member Author

Choose a reason for hiding this comment

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

We're now able to discriminate on the type property to indicate if it's a platform or a platform guide. This is a lot cleaner.

Copy link
Member Author

Choose a reason for hiding this comment

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

Everything is typed much better in here, making a bit more clear the distinction between a Platform and a PlatformGuide.

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-platforms-improve-implementation-of-platformregistry branch from b5271ee to 48d64b4 Compare July 25, 2023 18:59
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

The data model is a little confusing here, but that's not really anything as far as this PR is concerned. LGTM, thanks! Just a buncha typos

};

export function GuideGrid({platform, className}: Props) {
const [currentPlatform] = usePlatform(platform);
Copy link
Member

Choose a reason for hiding this comment

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

🤔 a little confusing that usePlatform might return a guide, but I guess that's just the data model?

} from '../types';

/**
* Common default values that all platform configs will recieve (but may be
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Common default values that all platform configs will recieve (but may be
* Common default values that all platform configs will receive (but may be

this._keyMap = {};
/**
* When the given config object has a fallbackPlatform, this will ensure the
* `propegatedConfig` keys are present with their values from the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* `propegatedConfig` keys are present with their values from the
* `propagatedConfig` keys are present with their values from the

}

/**
* Constructs the patlform registry mapping object.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Constructs the patlform registry mapping object.
* Constructs the platform registry mapping object.

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-platforms-improve-implementation-of-platformregistry branch from e285f45 to ed5afe3 Compare July 25, 2023 23:57
Copy link
Contributor

@shanamatthews shanamatthews left a comment

Choose a reason for hiding this comment

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

This hurt my brain a little, but I'm on board that this refactor helps

This change simplfies the PlatformRegistry
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-platforms-improve-implementation-of-platformregistry branch from ed5afe3 to 35dc377 Compare July 26, 2023 00:35
@evanpurkhiser evanpurkhiser merged commit 4f9e05b into master Jul 26, 2023
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-platforms-improve-implementation-of-platformregistry branch July 26, 2023 17:41
shanamatthews pushed a commit that referenced this pull request Jul 31, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants