Coder Social home page Coder Social logo

Comments (6)

liximomo avatar liximomo commented on May 27, 2024

Could you provide a reproduction-repo?

from lazy-compile-webpack-plugin.

devtreehouse avatar devtreehouse commented on May 27, 2024

Sure! Ran into some setup issues when duplicating fresh repo. Reaching out to storybook team first.

from lazy-compile-webpack-plugin.

devtreehouse avatar devtreehouse commented on May 27, 2024

There was an issue I ran into trying to repro. But found out it doesn't even work with most recent storybook.
storybookjs/storybook#10156
Still waiting for their response, but thought it might help to post it here as well, as other plugins seem to work fine but not lazy-compile-webpack-plugin

from lazy-compile-webpack-plugin.

devtreehouse avatar devtreehouse commented on May 27, 2024

@liximomo I think I have some new information. Reached out to storybook team, and they are using https://www.npmjs.com/package/virtual-module-webpack-plugin
in their latest version.
This means their file is sometimes generated in the cache and not available on the disk. In your code

async _recompile(filename) {
    return new Promise((resolve, reject) => {
      const now = new Date();

      // trigger watcher to recompile
      fs.utimes(filename, now, now, err => {
        if (err) {
          return reject(err);
        }

        resolve();
      });
    });
  }

utime relies on the file system on found modules. And that is causing it to be incompatible with newer storybook version.
This is not super related to the issueI raised. If you prefer I raise it as a separate issue for semantic I could.
For now I'll focus on duplicating this issue with an older version of storybook (if that's possible)

from lazy-compile-webpack-plugin.

devtreehouse avatar devtreehouse commented on May 27, 2024

@liximomo I have successfully duplicated the bug in the repository:
https://github.com/devtreehouse/StorybookLazyCompile

To start the app, clone the repo, do yarn, and then yarn storybook. Storybook will spin up.
Sometimes the build only does once, sometimes it does twice or even 3 times.

One time:
image
Three times:
image

In our production repo, one build takes 2 minutes, so... rebuilding means waiting for 2 more minutes randomly, that means it defeats the purpose of saving time on lazy compile.

Additional context:
In our main app, I realized that on the second build, it goes and try to do a full build, that means all react suspense (code splitted) code will be built. But it doesn't happen on the first time.
Also I noticed the first build is not success, as some images on our webpage are not being displayed. I think it might be webpack trying to make up for it, but it never happens without this plugin enabled.

Would greatly appreciate it if you can take a look. I really want to use this in our official dev environment

from lazy-compile-webpack-plugin.

devtreehouse avatar devtreehouse commented on May 27, 2024

Reopening a new issue as too much irrelevant information is in this thread

from lazy-compile-webpack-plugin.

Related Issues (10)

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.