Skip to content

Conversation

@davidfirst
Copy link
Member

@davidfirst davidfirst commented Oct 28, 2025

Summary

Fixes a bug where aspect data fields (like packageName, componentRangePrefix) were being lost during bare-scope lane merges.

Root Cause

When merging lanes using bare-scope merge:

  1. Components are loaded from scope with correct data ✅
  2. Merged config is applied via addAspectsFromConfigObject
  3. ExtensionDataList.fromConfigObject creates entries with only config, no data
  4. When merging configs, the config-only entries overwrite existing entries that contain data ❌

The Fix

Added code in addAspectsFromConfigObject to restore data fields from original extensions after merging configs:

extensionDataList.forEach((ext) => {
  const originalExt = consumerComponent.extensions.findExtension(ext.stringId, true);
  if (originalExt && originalExt.data) {
    ext.data = originalExt.data;
  }
});

This ensures components that skip aspect loading (PR #9570 optimization) still have their data preserved.

…Scope

When merging lanes using bare-scope merge, aspect data fields (like packageName)
were being lost. This occurred because:

1. Components are loaded from scope with correct data
2. Merged config is applied via addAspectsFromConfigObject
3. ExtensionDataList.fromConfigObject creates entries with only config, no data
4. When merging configs, the config-only entries overwrite existing entries with data

The fix restores data fields from original extensions after merging configs.
This ensures components that skip aspect loading (PR #9570 optimization) still
have their data preserved.

Also added detailed comments explaining the PR #9570 optimization and how
components that skip aspect recalculation rely on data preservation and
the addDeps() method for dependency updates.
@davidfirst davidfirst merged commit 7981529 into master Oct 28, 2025
11 checks passed
@davidfirst davidfirst deleted the fix/preserve-aspect-data-during-config-merge branch October 28, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants