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

Add support for Roblox internal Stories and Storybooks #29

Draft
wants to merge 49 commits into
base: main
Choose a base branch
from

Conversation

vocksel
Copy link
Contributor

@vocksel vocksel commented Nov 21, 2024

Problem

Solution

Breaking change: loadStorybookModule's arguments have been reversed. Signature changed from `(ModuleLoader, ModuleScript) -> LoadedStorybook` to `(ModuleScript, ModuleLoader) -> LoadedStorybook`. Loaders are now optional for the consumer to supply
The loader is now instantiated and attached to the storybook implicitly in most cases. This improves sandboxing between storybooks

Breaking change: loadStorybookModule's arguments have been reversed. Signature changed from `(ModuleLoader, ModuleScript) -> LoadedStorybook` to `(ModuleScript, ModuleLoader?) -> LoadedStorybook`. Loaders are now optional for the consumer to supply

Also keep track of the source module
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remember to remove this before merging

vocksel added a commit that referenced this pull request Dec 29, 2024
# Problem

A Roblox internal use case requires initializing a particular singleton
module only once. This initialization usually happens in storybooks,
which are all put into the same module loader. We need to sandbox each
storybook's modules to avoid collisions

# Solution

The loader is now instantiated and attached to the storybook implicitly
in most cases. This improves sandboxing between storybooks.

This PR was split from #29 

> [!IMPORTANT]
> Breaking change: `loadStorybookModule`'s arguments have been reversed.
Signature changed from `(ModuleLoader, ModuleScript) -> LoadedStorybook`
to `(ModuleScript, ModuleLoader?) -> LoadedStorybook`. Loaders are now
optional for the consumer to supply
Comment on lines +14 to +15
| `mapDefinition` | `((story: any) -> any)?` | |
| `mapStory` | `((story: any) -> (props: StoryProps) -> any)?` | |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Either add support for mapStory and mapDefinition to all renderers or mark them as Roblox internal only and remove mention from the docs

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.

1 participant