-
Notifications
You must be signed in to change notification settings - Fork 1
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
Performance issues with watch mode #2
Comments
I will do some investigation, there may be some optimisations I can make; it's likely that the .d.ts plugin which is being wrapped here is not getting the benefit of the caching + incremental behaviour from webpack and/or typescript. Disabling the declarations bundle output in watch mode for now is perfectly ok unless you are working closely with the .d.ts output, but I understand that 10seconds is an unreasonable time to wait when this is the case, will see what I can do :) |
So just to properly understand, is the problem that it blocks your watch build from completing for this time, or that it takes 10 seconds to receive the .d.ts output? If the problem is that it's impacting other aspects of the build we could consider running a separate parallel build for it, or running a background worker while in watch mode (similar idea to what |
see: timocov/dts-bundle-generator#190 The bundling also seems to have slowed down a bit; will see what I can do to mitigate this for webpack watch temporarily. |
Currently, it blocks the entire watch build. I think a separate parallel build or a background worker might help. Nevertheless, I need the output of the declaration bundle for other modules within the same workspace. However, the declarations don't change that often and I can accept if they are updated with a delay as long as the rest of the build is not blocked. |
Latest version of the library I'm wrapping does seem a little slow (taking about 12seconds to build this small library); I will look into this separately but will also try to take the .d.ts out of watchRun compilations so that it works out of process with a delay. To be honest, I don't remember the dts-bundle-generator taking as long as this the last time I worked with it so not sure what's up, should really be at least comparable to the transpile & check. |
I haven't measured it. However, I also think it was quite faster in the past. |
Thank you for your quick and promising solution! I have just tested it. There seems to be an issue with the file extension. After updating to version 4.0.0, I receive an error when starting Webpack with watch mode:
By the way, I have a |
When renaming However, I run in another issue now. The generated |
Interesting... I will add some tests around this and see if I can reproduce it; the idea is that the usage remains the same, but it will detect watch mode and use the worker in this instance. Both ESM & CJS should be supported, but glancing at it there might be an issue with both ESM & CJS for the worker chunk having a js extension (this might actually be a parcel bug, will look into it, would have expected the CommonJS to use .cjs) |
Should find it works in version 4.0.1 of the library 🙏 At least for now, I'm just updating it to rename the parcel output before packing the library. Thank you for your patience on this! |
Oh! one other thing which is worth calling out here is that I also made the plugin emit an |
When using this plugin and having watch mode enabled in my Webpack configuration, I have serious performance issues. Without the plugin, Webpack needs just a few milliseconds for incremental runs. However, with the plugin, Webpack needs more than 10 seconds for incremental runs for my project.
OS: Windows 10
Webpack: 5.75.0
bundle-declarations-webpack-plugin: 3.1.1
Is there anything we can do? Currently, I disable
bundle-declarations-webpack-plugin
completely when watch mode is enabled as a workaround.The text was updated successfully, but these errors were encountered: