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: root components are grouped by envs and apps #6800

Merged
merged 23 commits into from
Feb 19, 2023
Merged

feat: root components are grouped by envs and apps #6800

merged 23 commits into from
Feb 19, 2023

Conversation

zkochan
Copy link
Member

@zkochan zkochan commented Dec 15, 2022

Proposed Changes

  • This PR changes how the root components feature is working.
  • From now on if the root components feature is enabled, Bit will generate a folder called .bit_roots in the root of your node_modules folder.
    This folder will contain a sub-folder for 2 entities:
  1. each env that is used by at least one of your components in the workspace
  2. any app existing in your workspace.
    These folders under the .bit_roots are called root components. each one of them represents a root.
  • Each root will have links to all components in the workspace with the peer dependencies resolved from the root entity.
    for example, if you have an env that sets React to v18 and another root that sets React to v17, the version of react will be determined by the version of the root component.
    so a button created in the react 17 env when used inside a composition of components created by a react 18 env will get react v18 at runtime.
    While in the composition of itself, it will get react 17 at runtime.

  • Here is an example of the top level structure of the .bit_roots folder when root components is enabled

root comps structure

- Here is an example of the structure of one of the root components

root comps inner structure

  • enable "rootComponents" by setting the following in the workspace.jsonc
"teambit.dependencies/dependency-resolver": {
    "rootComponents": true,
}

@zkochan zkochan force-pushed the root-comps branch 2 times, most recently from 509a1bb to 913a0e3 Compare January 10, 2023 12:40
@zkochan zkochan force-pushed the root-comps branch 3 times, most recently from 10636b7 to ca1db4c Compare January 26, 2023 06:20
davidfirst
davidfirst previously approved these changes Jan 26, 2023
@zkochan zkochan force-pushed the root-comps branch 5 times, most recently from 6b8104b to 9f92486 Compare January 30, 2023 17:06
@zkochan zkochan marked this pull request as ready for review January 31, 2023 17:43
@zkochan zkochan force-pushed the root-comps branch 4 times, most recently from dbc9156 to d35b8e2 Compare February 1, 2023 22:08
@zkochan zkochan enabled auto-merge (squash) February 2, 2023 12:45
@zkochan zkochan force-pushed the root-comps branch 2 times, most recently from 30db62e to 5ccb22e Compare February 5, 2023 14:27
@zkochan zkochan merged commit 4c8dd8a into master Feb 19, 2023
@zkochan zkochan deleted the root-comps branch February 19, 2023 12:26
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.

3 participants