Skip to content

Conversation

ClarkXia
Copy link
Collaborator

This pull request introduces a fix to ensure the server bundle is recompiled whenever the assets manifest changes. The changes involve detecting modifications to the assets manifest and triggering a rebuild if necessary.

@ClarkXia ClarkXia requested review from Copilot, XGHeaven and XXXMrG July 22, 2025 07:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the server bundle was not being recompiled when the assets manifest changed during development. The fix introduces detection logic to compare old and new assets manifest content and forces a full rebuild when changes are detected.

  • Adds assets manifest change detection by comparing JSON stringified versions
  • Modifies the compilation flow to force full rebuilds instead of incremental rebuilds when manifest changes
  • Extends the buildResult type to include an assetsManifestChanged flag for tracking state

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/ice/src/webpack/ServerCompilerPlugin.ts Implements assets manifest change detection and forces full rebuild when changes occur
.changeset/big-cats-act.md Adds changeset entry documenting the fix

const oldAssetsManifest = this.compilerOptions.compilationInfo.assetsManifest;

// Check if assets manifest has changed
if (JSON.stringify(oldAssetsManifest) !== JSON.stringify(newAssetsManifest)) {
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

Using JSON.stringify() for deep comparison is inefficient and can be unreliable due to property ordering. Consider using a dedicated deep comparison utility or computing a hash of the manifest content for more reliable change detection.

Copilot uses AI. Check for mistakes.

@@ -51,6 +58,9 @@ export default class ServerCompilerPlugin {
this.task = null;
}
});
} else if (assetsManifestChanged && this.buildResult?.context?.rebuild) {
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The variable assetsManifestChanged is declared inside the if (!this.isCompiling) block but is used outside of it. This will cause a ReferenceError when this.isCompiling is true, as the variable will be undefined in the outer scope.

Copilot uses AI. Check for mistakes.

Base automatically changed from release/next to master July 24, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant