Comments (13)
@pciarach Thanks for the context. This might be a known problem with no easy fix, but I'll ask our local Webpack experts and we'll see what we can figure out. @ndelangen @valentinpalkovic @tmeasday ?
from storybook.
@pciarach Can you try in 8.0.x? I have a theory about what's going wrong
from storybook.
@shilman Unfortunately, the same happens on 8.0.10 :(
from storybook.
@pciarach well i guess the good news is that fixing this bug might be a low-hanging optimization opportunity.
Did you encounter this problem during an upgrade from an old version that did not have this problem?
from storybook.
@shilman Well, sort of. We did two upgrades recently (7.0.7 => 7.16.7 => 8.1.5) but I've just gone back in the git history and it seems that both previous versions we had were affected as well so it seems that we didn't notice that before.
from storybook.
@shilman do you have a reproduction repo of this behaviour?
from storybook.
@tmeasday This happens even on the clean sandbox repository (npx storybook@next sandbox
with React latest + webpack 5 template). Please note that this second build I'm referring to is quite fast on this repo but [my assumption is that it] increases in proportion to number of stories.
from storybook.
@pciarach I'm not sure what I am looking for. I did:
- Create a sandbox with
react-webpack/18-ts
- Ran
yarn storybook
- It opened a browser with the welcome screen. I was watching the terminal and it didn't print anything else / there was no further activity in the browser.
from storybook.
@tmeasday This is what I see in the output and in the browser:
It's less than one second there (as there are only 3 stories :D) but on the bigger repo it is almost as long as the first build:
from storybook.
@pciarach OK I see what you mean. Does adding this to main.js
help with the problem for you?
webpackFinal: (config) => ({
...config,
watchOptions: {
ignored: /(node_modules|storybook-config-entry|storybook-stories)/,
},
}),
It feels like this is a bug in https://github.com/sysgears/webpack-virtual-modules - @ndelangen any ideas?
from storybook.
@tmeasday Yes, it also helps (and it's definitely better workaround than my physical files ^^)
from storybook.
@tmeasday I've been thinking of removing the need to have https://github.com/sysgears/webpack-virtual-modules for some time.
I think if we performed code injection into the html template we could likely perform the same task, but without the "magic".
Not sure how much this comment helps us, right now. But for reference, we do not have anything like virtual modules on the manager's side, because we do this:
storybook/code/builders/builder-manager/templates/template.ejs
Lines 77 to 85 in 94cb5fc
that + prebundling + globalization
To solve the immediately issue, we could easily add the following to the default webpack config:
webpackFinal: (config) => ({
...config,
watchOptions: {
ignored: /(node_modules|storybook-config-entry|storybook-stories)/,
},
}),
That feels rather safe to me.
from storybook.
@ndelangen the idea of getting rid of virtual modules seems good. But I'm not sure how it would work with Webpack's HMR?
from storybook.
Related Issues (20)
- [Bug]: Seeing warning about CJS even though my project is ESM HOT 3
- [Bug]: themes.normal not working for docs pages HOT 6
- Blog Post: Highlight the feature
- [Bug]: Addon build fails due to missing @storybook/manager/globals on 8.2.5 HOT 3
- [Bug]: Upgrade still prompts for all automigrations HOT 1
- [Bug]: Incorrect null type error for ControlType HOT 3
- UI: solidify story status elements HOT 1
- UI: Rework footer filtering component and API HOT 1
- Remove/deprecate experimental bottomBar APIs in Storybook core [gert] HOT 1
- Move bottom bar button (filter) logic from VTA to Storybook [gert] HOT 2
- Migration strategy with different versions of Storybook+VTA (so that there is only filter UI)
- Rework file transformation logic [yann] HOT 2
- Use internal Storybook renderer logic for portable stories in 8.3 (as a default), as it will solve hard to debug race conditions and allows us to run the vitest test runner for all renderers [kasper]
- Portable stories: Refactor Storybook preview and Portable stories to reuse logic [kasper]
- Scaffold `@storybook/addon-vitest` with basic mocked test results [gert] HOT 1
- Server/browser state for status API from JUnit report [yann, gert] HOT 1
- [Bug]: Absolute import from MDX does not work HOT 2
- [Bug]: PNPM Install returning errors HOT 4
- [Bug]: Failed to build the preview SB_BUILDER-WEBPACK5_0002 (WebpackInvocationError): Module not found: Error: Can't resolve './Typography' in './components/Typography' HOT 1
- [Bug]: PanelPosition on mobile Viewports not working / is alway bottom HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.