Skip to content

Conversation

@matyasf
Copy link
Collaborator

@matyasf matyasf commented Nov 6, 2024

The main goal of this PR is to make it possible to run InstUI v8/v9 in the same page as InstUI v10 when the host app uses the older version and a later initialized one v10.
Currently this causes the v10 app to look buggy because ThemeRegistry will return an incompatible v8 theme object:

in canvas.ts:

const theme = ThemeRegistry.registerTheme(__theme)
export default theme

in ThemeRegistry.registerTheme:

if (theme.key && registry.themes[theme.key]) {
    return registry.themes[theme.key] as RegisteredTheme<T>
  }

This PR makes it possible to get the theme directly circumventing ThemeRegistry and its theme cache. Also deprecates ThemeRegistry (which is used for global themes)

@matyasf matyasf self-assigned this Nov 6, 2024
@github-actions
Copy link

github-actions bot commented Nov 6, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-11-22 12:41 UTC

@matyasf matyasf force-pushed the deprecate_globalthis branch from 4d59415 to 7aab574 Compare November 11, 2024 13:13
@matyasf matyasf changed the title WIP: Have a way to circumvent the global theme registry Make it possible to not use global theme registry. Deprecate global theme registry. Nov 11, 2024

const theme = ThemeRegistry.registerTheme(__theme)

export default theme
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the main change and what we will recommend people to use

@matyasf matyasf requested review from HerrTopi and balzss November 11, 2024 16:45
@matyasf matyasf changed the title Make it possible to not use global theme registry. Deprecate global theme registry. INSTUI-4322 Make it possible to not use global theme registry. Deprecate global theme registry. Nov 13, 2024
@matyasf matyasf merged commit 3e109be into master Nov 22, 2024
1 check passed
@matyasf matyasf deleted the deprecate_globalthis branch November 22, 2024 12:40
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