Skip to content
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

Remove concept of snapshot filters from dependency tree data handling #7992

Merged
merged 8 commits into from
Mar 24, 2022

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Mar 21, 2022

We have been slowly working towards removing this concept from the dependency tree as it complicates understanding of view state from the publisher's perspective.

PR #7990 left only one such filter, meaning we can inline that instance, simplify it (as we don't need a general pattern), and remove the interface and supporting types needed for filters.

Before

%% TODO add click handlers:
%%   click A "https://github.com/dotnet/project-system/..." "Click to view source"

flowchart LR
  subgraph UnconfiguredProject Scope
    filters[IDependenciesSnapshotFilter]
    handlers[IDependenciesRuleHandler]
    subgraph ConfiguredProject Scope
      direction TB
      subgraph CPS Data Sources
        evaluation([Evaluation Data])
        design-time-build([Design-time Build Data])
      end
    end
    evaluation == "snapshot + delta" ==> DependencyRulesSubscriber
    design-time-build == "snapshot + delta" ==> DependencyRulesSubscriber
    handlers -- "import many" -.-> DependencyRulesSubscriber
    filters -- "import many" -.-> DependencyRulesSubscriber
    DependencyRulesSubscriber -- "IDependenciesChanges (delta)" --> DependenciesSnapshotProvider
    IDependenciesTreeViewProvider["IDependenciesTreeViewProvider.BuildTreeAsync"]
    DependenciesSnapshotProvider == DependenciesSnapshot ==> IDependenciesTreeViewProvider
    IDependenciesTreeViewProvider -- IProjectTree --> ProjectTreeProviderBase.SubmitTreeUpdateAsync
  end
Loading

After

flowchart LR
  subgraph UnconfiguredProject Scope
    handlers[IDependenciesRuleHandler]
    subgraph ConfiguredProject Scope
      direction TB
      subgraph CPS Data Sources
        evaluation([Evaluation Data])
        design-time-build([Design-time Build Data])
      end
    end
    evaluation == "snapshot + delta" ==> DependencyRulesSubscriber
    design-time-build == "snapshot + delta" ==> DependencyRulesSubscriber
    handlers -- "import many" -.-> DependencyRulesSubscriber
    DependencyRulesSubscriber -- "IDependenciesChanges (delta)" --> DependenciesSnapshotProvider
    IDependenciesTreeViewProvider["IDependenciesTreeViewProvider.BuildTreeAsync"]
    DependenciesSnapshotProvider == DependenciesSnapshot ==> IDependenciesTreeViewProvider
    IDependenciesTreeViewProvider -- IProjectTree --> ProjectTreeProviderBase.SubmitTreeUpdateAsync
  end

  click handlers "https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/CrossTarget/IDependenciesRuleHandler.cs" "Click to view source"
  click DependencyRulesSubscriber "https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Subscriptions/DependencyRulesSubscriber.cs" "Click to view source"
  click IDependenciesTreeViewProvider "https://github.com/dotnet/project-system/blob/main/src/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/IDependenciesTreeViewProvider.cs" "Click to view source"
  click DependenciesSnapshotProvider "https://github.com/dotnet/project-system/blob/main/src/src/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Subscriptions/DependenciesSnapshotProvider.cs" "Click to view source"
Loading
Microsoft Reviewers: Open in CodeFlow

@drewnoakes drewnoakes added the Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references label Mar 21, 2022
@drewnoakes drewnoakes requested a review from a team as a code owner March 21, 2022 07:02
@drewnoakes drewnoakes force-pushed the remove-dependency-snapshot-filters branch from ee81788 to 1530050 Compare March 23, 2022 02:11
With recent changes, we have removed all but one of the snapshot filters. As we are trying to remove this concept from the code, we can now inline that base class into its sole implementation to reduce the number of types in the assembly.
Over time we've worked towards removing the concept of filters. A recent change leaves only one such filter, meaning we can inline that instance, simplify it (as we don't need a general pattern), and remove the interface and supporting types needed for filters.
@drewnoakes drewnoakes force-pushed the remove-dependency-snapshot-filters branch from 037f418 to 6763860 Compare March 24, 2022 00:12
@drewnoakes drewnoakes merged commit 4d57375 into dotnet:main Mar 24, 2022
@drewnoakes drewnoakes deleted the remove-dependency-snapshot-filters branch March 24, 2022 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants