Skip to content

Commit

Permalink
chore: explain react deps in angular host dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Sep 28, 2023
1 parent 7ca319c commit 548633a
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 15 deletions.
5 changes: 5 additions & 0 deletions angular/devkit/preview/preview/angular-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export class AngularPreview implements Preview {
return this.bundlerProvider(context);
}

/**
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
getHostDependencies(): string[] {
return (
this.hostDependencies || [
Expand Down
5 changes: 3 additions & 2 deletions angular/envs/base-env/preview/host-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
5 changes: 3 additions & 2 deletions angular/examples/my-angular-env/preview/host-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
'@mdx-js/react',
'react',
'react-dom',
];
];
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ export const hostDependenciesFile = () => {
return {
relativePath: './preview/host-dependencies.ts',
content: `/**
* dependencies to be bundled only once, in the env preview template, and not in each component preview.
* Dependencies to be bundled only once, in the env preview template, and not in each component preview.
* most of your peer dependencies should be listed here to avoid duplications in the preview.
* React, ReactDOM, and MDX are included as they are part of the preview ui.
*/
export default [
'@teambit/mdx.ui.mdx-scope-context',
Expand Down

0 comments on commit 548633a

Please sign in to comment.