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

feat: store dependencies graph in component model #9214

Draft
wants to merge 70 commits into
base: master
Choose a base branch
from

Conversation

zkochan
Copy link
Member

@zkochan zkochan commented Sep 24, 2024

Proposed Changes

Example of the dependencies graph object: https://gist.github.com/zkochan/1ef61728cf8605d7e9e6832a684d5b2f

TODO:

  • get the dependency graph from root components.
  • what to do if the component uses another component in the workspace? We don't know what the integrity of that component will be when it gets published.
  • validate that component dependency versions are updated in the model in all scenarios
  • make the change opt-in via the bit features env variable.
  • importing components to an existing workspace (with an existing lockfile).
  • don't write node_modules in e2e tests. We only need the lockfile. no way to skip install as next steps fail
  • in e2e tests skip preview in tagged components previews are disabled in e2e tests by default
  • Test what happens if you import 2 components - one with new data one without
  • Test with old bit version when import/build a component with new data
  • change feature flag to only use data
  • Add an example of the data format into this PR
  • ignore data if it has unsupported schema version.

scopes/component/isolator/isolator.main.runtime.ts Outdated Show resolved Hide resolved
Comment on lines +958 to +959
consumerComponents: ConsumerComponent[],
components: Component[]
Copy link
Member

Choose a reason for hiding this comment

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

maybe switch the args order here so it will be same as the order in tagModelComponent args

Copy link
Member Author

Choose a reason for hiding this comment

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

tagModelComponent has a single options argument.

scopes/component/snapping/snapping.main.runtime.ts Outdated Show resolved Hide resolved

export type DependenciesGraph = {
schemaVersion: string;
directDependencies: DirectDependency[];
Copy link
Member

Choose a reason for hiding this comment

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

what are the direct deps represent? like the policy of the workspace.jsonc?

src/scope/models/version.ts Outdated Show resolved Hide resolved
src/scope/models/version.ts Outdated Show resolved Hide resolved
src/scope/models/version.ts Outdated Show resolved Hide resolved
nodeId: string;
};

export type DependenciesGraph = {
Copy link
Member

Choose a reason for hiding this comment

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

I would consider making this a class and not just a type, so you can make an API for it.

Copy link
Member

Choose a reason for hiding this comment

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

Also maybe make it an instance of clear graph? or a composition of cleargraph (so you will put the node and edges inside on a cleargraph instance, then you can make APIs that calls cleargraph internally)

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