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

fix: fixed typing for shadow root element. updated tests to reflect changes #2048

Merged
merged 7 commits into from
Dec 5, 2023

Conversation

chrispulsinelli-okta
Copy link
Contributor

Summary

  • Change shadow root element type from HTMLDivElement to HTMLElement to avoid need to cast
  • Fixed broken shadow dom themed tests
  • Updated tests to show how to use OdysseyProvider

OKTA-670823

Testing & Screenshots

  • I have confirmed this change with my designer and the Odyssey Design Team.

Copy link
Contributor

@bryancunningham-okta bryancunningham-okta left a comment

Choose a reason for hiding this comment

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

One small comment. Otherwise looks good to me

@chrispulsinelli-okta chrispulsinelli-okta force-pushed the cp-OKTA-670823-fix-odyssey-provider branch from 2e85a3a to a9fe841 Compare November 30, 2023 21:11
@chrispulsinelli-okta chrispulsinelli-okta force-pushed the cp-OKTA-670823-fix-odyssey-provider branch from a9fe841 to cd96f2b Compare December 4, 2023 17:51
Copy link
Contributor

@benschell-okta benschell-okta left a comment

Choose a reason for hiding this comment

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

LGTM, selfishly happy to have this working!

Comment on lines 63 to 87
const uniqueAlphabeticalId = useUniqueAlphabeticalId();

const cache = useMemo(
() =>
createCache({
...(emotionRoot && { container: emotionRoot }),
key: uniqueAlphabeticalId,
prepend: true,
nonce: window.cspNonce,
speedy: false,
}),
[emotionRoot, uniqueAlphabeticalId]
);

if (withCache) {
return (
<CacheProvider value={cache}>
<MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>
<OdysseyDesignTokensContext.Provider value={odysseyTokens}>
{children}
</OdysseyDesignTokensContext.Provider>
</MuiThemeProvider>
</CacheProvider>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned about the added complexity here (if we otherwise discourage use of this provider directly). BUT if it's broken as-is (and someone is using it directly instead of OdysseyProvider), then it makes sense to make it functional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your thoughts on this. I don't have the context on why we need this provider (since OdysseyProvider already includes this one), but I wanted to make sure that the emotion cache worked and was available should someone use this provider directly.

@chrispulsinelli-okta chrispulsinelli-okta merged commit 3ae92a1 into main Dec 5, 2023
1 check passed
@chrispulsinelli-okta chrispulsinelli-okta deleted the cp-OKTA-670823-fix-odyssey-provider branch December 5, 2023 20:48
@KevinGhadyani-Okta
Copy link
Contributor

KevinGhadyani-Okta commented Dec 7, 2023

This PR removes the nonce and stylisPlugins variables which is a major breaking change.

I want the ability to pass a custom nonce in case you're not in Monolith (Iris) and need a custom one. Also Storybook doesn't have a window.nonce.

stylisPlugins needs to be there for SIW's IE11 compatibility mode.

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.

4 participants