Skip to content

fix(dts-plugin): do not regen types on hmr if dev false#3223

Merged
ScriptedAlchemy merged 2 commits intomainfrom
fix/dev-false-dts-regen
Nov 20, 2024
Merged

fix(dts-plugin): do not regen types on hmr if dev false#3223
ScriptedAlchemy merged 2 commits intomainfrom
fix/dev-false-dts-regen

Conversation

@ScriptedAlchemy
Copy link
Copy Markdown
Member

Description

when dev:false only generate types on initial build and not on HMR updates

Related Issue

#3110

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 14, 2024

🦋 Changeset detected

Latest commit: 710e92c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/manifest Patch
@module-federation/rspack Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/runtime Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 14, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 710e92c
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/6735a0c8d85045000892f25a
😎 Deploy Preview https://deploy-preview-3223--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Contributor

@squadronai squadronai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Here is a concise summary of the pull request:

The key changes in this pull request optimize the behavior of the dts-plugin when the dev option is set to false. Specifically, the changes ensure that types are only generated on the initial build and not during subsequent Hot Module Replacement (HMR) updates. This optimization improves the overall build performance by avoiding unnecessary type regeneration. The changes are focused on the GenerateTypesPlugin.ts file and are intended to address an existing issue (#3110) related to type generation during HMR.

File Summaries
File Summary
packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts The code changes introduce a new condition to skip regenerating types during Hot Module Replacement (HMR) when the dev option is set to false. This optimization ensures that types are only generated on the initial build and not on subsequent HMR updates, improving the overall build performance.

@ScriptedAlchemy
Copy link
Copy Markdown
Member Author

Going to have user test the Canary before I merge

@ScriptedAlchemy ScriptedAlchemy merged commit 8db7611 into main Nov 20, 2024
@ScriptedAlchemy ScriptedAlchemy deleted the fix/dev-false-dts-regen branch November 20, 2024 21:34
@2heal1 2heal1 mentioned this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants