Code Monkey home page Code Monkey logo

Comments (13)

shilman avatar shilman commented on August 28, 2024 1

@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.

shilman avatar shilman commented on August 28, 2024

@pciarach Can you try in 8.0.x? I have a theory about what's going wrong

from storybook.

pciarach avatar pciarach commented on August 28, 2024

@shilman Unfortunately, the same happens on 8.0.10 :(

from storybook.

shilman avatar shilman commented on August 28, 2024

@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.

pciarach avatar pciarach commented on August 28, 2024

@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.

tmeasday avatar tmeasday commented on August 28, 2024

@shilman do you have a reproduction repo of this behaviour?

from storybook.

pciarach avatar pciarach commented on August 28, 2024

@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.

tmeasday avatar tmeasday commented on August 28, 2024

@pciarach I'm not sure what I am looking for. I did:

  1. Create a sandbox with react-webpack/18-ts
  2. Ran yarn storybook
  3. 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.

pciarach avatar pciarach commented on August 28, 2024

@tmeasday This is what I see in the output and in the browser:
image

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:
image

from storybook.

tmeasday avatar tmeasday commented on August 28, 2024

@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.

pciarach avatar pciarach commented on August 28, 2024

@tmeasday Yes, it also helps (and it's definitely better workaround than my physical files ^^)

from storybook.

ndelangen avatar ndelangen commented on August 28, 2024

@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:

<script type="module">
import './sb-manager/globals-runtime.js';
<% files.js.forEach(file => { %>
import '<%= file %>';
<% }); %>
import './sb-manager/runtime.js';
</script>

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.

tmeasday avatar tmeasday commented on August 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.