Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ember is swapping its build system to be powered by vite - and all Emberenos are very excited.
Ember's old (classic) build system is still in use and we expect the community to migrate. Migrating your ember app to vite is what we all want to do, but not done overnight, we are speaking about months to quarters.
Ember build systems and their compatibility with storybook:
Plan with Ember
What I want to support with Ember in general
*.stories.gjsand*.stories.gts(Ember's file extension)What I did
I started to port over Ember to use
@storybook/builder-vite. Withember@6.8(at the time I started the project,ember@6.8wasbeta) there is also the newrenderComponent()API, which was designed for situations like storybook integration.I figured the Storybook APIs to make that work. And was able to make a
button.stories.gjsfile able to run through that loader - but then things starting to break.I have not done any cleanup of the existing code (you still see old things that surely are candidate for removal)
Where is it Breaking?
Storybook serve
When Storybook serves (through
esbuild), it "optimizes" things not clearly enough and duplicates Ember (glimmer) code. Ember follows the Highlander principle (there can only be one!) and duplicated code is the enemy here:COMPONENT_MANAGERS(aWeakMap) showing up in two locations leads to this error:Storybook build
When storybook builds (through
rollup) the assets for hosting your storybook different errors show up:What's next?
The build system needs taming. I myself am running out of options, I'm hoping for the ember community to support here.