@teambit/react 0.0.881 → 0.0.882
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +2 -2
- package/artifacts/env-template/public/{238.2ddc5a20aad2fef149e6.js → 700.fcb0085dcdf160cc65c9.js} +15 -15
- package/artifacts/env-template/public/assets-manifest.json +16 -16
- package/artifacts/env-template/public/{compositions.c4e18d110cce13606364.js → compositions.d36450c5ae70173e7a70.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.085d128a4f5272ef7319.js → overview.ca1695b4bf4d507d7a28.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/peers.9642cecf0c09b9d93f54.js +1 -0
- package/artifacts/env-template/public/{preview-root.b9ea187989f25bad7bf4.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
- package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
- package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
- package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1666409808293.js → compositions-1666496165706.js} +0 -0
- package/dist/apps/web/compute-results.js +0 -2
- package/dist/apps/web/compute-results.js.map +1 -1
- package/dist/apps/web/index.js +0 -3
- package/dist/apps/web/index.js.map +1 -1
- package/dist/apps/web/plugins/index.js +0 -3
- package/dist/apps/web/plugins/index.js.map +1 -1
- package/dist/apps/web/plugins/prerender.js +0 -14
- package/dist/apps/web/plugins/prerender.js.map +1 -1
- package/dist/apps/web/react.app-type.js +0 -7
- package/dist/apps/web/react.app-type.js.map +1 -1
- package/dist/apps/web/react.application.js +11 -76
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/apps/web/ssr/ssr-express.js +0 -31
- package/dist/apps/web/ssr/ssr-express.js.map +1 -1
- package/dist/apps/web/webpack/mutators.js +0 -13
- package/dist/apps/web/webpack/mutators.js.map +1 -1
- package/dist/apps/web/webpack/webpack.app.ssr.config.js +0 -11
- package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
- package/dist/eslint/eslintrc.js +1 -1
- package/dist/eslint/eslintrc.js.map +1 -1
- package/dist/highlighter-widget.js +0 -16
- package/dist/highlighter-widget.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/jest/index.js +0 -7
- package/dist/jest/index.js.map +1 -1
- package/dist/jest/jest.base.config.js +3 -3
- package/dist/jest/jest.base.config.js.map +1 -1
- package/dist/jest/jest.cjs.config.js +0 -10
- package/dist/jest/jest.cjs.config.js.map +1 -1
- package/dist/jest/jest.config.js +1 -1
- package/dist/jest/jest.config.js.map +1 -1
- package/dist/jest/jest.esm.config.js +0 -10
- package/dist/jest/jest.esm.config.js.map +1 -1
- package/dist/jest/setupTests.js.map +1 -1
- package/dist/jest/transformers/base-transformer-plugins.js +1 -0
- package/dist/jest/transformers/base-transformer-plugins.js.map +1 -1
- package/dist/jest/transformers/base-transformer-presets.js +1 -0
- package/dist/jest/transformers/base-transformer-presets.js.map +1 -1
- package/dist/jest/transformers/base-transformer-process.js +0 -2
- package/dist/jest/transformers/base-transformer-process.js.map +1 -1
- package/dist/jest/transformers/cjs-transformer.js +0 -5
- package/dist/jest/transformers/cjs-transformer.js.map +1 -1
- package/dist/jest/transformers/css-transform.js +1 -2
- package/dist/jest/transformers/css-transform.js.map +1 -1
- package/dist/jest/transformers/esm-transformer.js +1 -5
- package/dist/jest/transformers/esm-transformer.js.map +1 -1
- package/dist/jest/transformers/file-transform.js +2 -6
- package/dist/jest/transformers/file-transform.js.map +1 -1
- package/dist/prettier/prettier.config.js.map +1 -1
- package/dist/react.aspect.js +0 -5
- package/dist/react.aspect.js.map +1 -1
- package/dist/react.composition.js +0 -6
- package/dist/react.composition.js.map +1 -1
- package/dist/react.env.js +34 -143
- package/dist/react.env.js.map +1 -1
- package/dist/react.graphql.js +0 -6
- package/dist/react.graphql.js.map +1 -1
- package/dist/react.main.runtime.js +23 -152
- package/dist/react.main.runtime.js.map +1 -1
- package/dist/react.preview.runtime.js +0 -32
- package/dist/react.preview.runtime.js.map +1 -1
- package/dist/react.templates.js +0 -46
- package/dist/react.templates.js.map +1 -1
- package/dist/react.ui.runtime.js +0 -35
- package/dist/react.ui.runtime.js.map +1 -1
- package/dist/templates/react-app/files/app-plugin.js +0 -1
- package/dist/templates/react-app/files/app-plugin.js.map +1 -1
- package/dist/templates/react-app/files/app-root.js +0 -1
- package/dist/templates/react-app/files/app-root.js.map +1 -1
- package/dist/templates/react-app/files/app.js +0 -1
- package/dist/templates/react-app/files/app.js.map +1 -1
- package/dist/templates/react-app/files/compositions.js +0 -1
- package/dist/templates/react-app/files/compositions.js.map +1 -1
- package/dist/templates/react-app/files/doc.js +0 -1
- package/dist/templates/react-app/files/doc.js.map +1 -1
- package/dist/templates/react-app/files/index.js +0 -1
- package/dist/templates/react-app/files/index.js.map +1 -1
- package/dist/templates/react-app/index.js +0 -19
- package/dist/templates/react-app/index.js.map +1 -1
- package/dist/templates/react-component/files/component.js +0 -2
- package/dist/templates/react-component/files/component.js.map +1 -1
- package/dist/templates/react-component/files/composition.js +0 -2
- package/dist/templates/react-component/files/composition.js.map +1 -1
- package/dist/templates/react-component/files/docs.js +0 -2
- package/dist/templates/react-component/files/docs.js.map +1 -1
- package/dist/templates/react-component/files/index-file.js +0 -2
- package/dist/templates/react-component/files/index-file.js.map +1 -1
- package/dist/templates/react-component/files/test.js +0 -2
- package/dist/templates/react-component/files/test.js.map +1 -1
- package/dist/templates/react-component/index.js +0 -24
- package/dist/templates/react-component/index.js.map +1 -1
- package/dist/templates/react-component-js/files/component.js +0 -2
- package/dist/templates/react-component-js/files/component.js.map +1 -1
- package/dist/templates/react-component-js/files/composition.js +0 -2
- package/dist/templates/react-component-js/files/composition.js.map +1 -1
- package/dist/templates/react-component-js/files/docs.js +0 -2
- package/dist/templates/react-component-js/files/docs.js.map +1 -1
- package/dist/templates/react-component-js/files/test.js +0 -2
- package/dist/templates/react-component-js/files/test.js.map +1 -1
- package/dist/templates/react-component-js/index.js +0 -21
- package/dist/templates/react-component-js/index.js.map +1 -1
- package/dist/templates/react-context/files/composition.js +0 -2
- package/dist/templates/react-context/files/composition.js.map +1 -1
- package/dist/templates/react-context/files/context-provider.js +0 -2
- package/dist/templates/react-context/files/context-provider.js.map +1 -1
- package/dist/templates/react-context/files/context.js +0 -2
- package/dist/templates/react-context/files/context.js.map +1 -1
- package/dist/templates/react-context/files/docs.js +0 -2
- package/dist/templates/react-context/files/docs.js.map +1 -1
- package/dist/templates/react-context/files/index-file.js +0 -2
- package/dist/templates/react-context/files/index-file.js.map +1 -1
- package/dist/templates/react-context/files/test.js +0 -2
- package/dist/templates/react-context/files/test.js.map +1 -1
- package/dist/templates/react-context/index.js +0 -19
- package/dist/templates/react-context/index.js.map +1 -1
- package/dist/templates/react-env/files/aspect.js +0 -1
- package/dist/templates/react-env/files/aspect.js.map +1 -1
- package/dist/templates/react-env/files/doc.js +0 -1
- package/dist/templates/react-env/files/doc.js.map +1 -1
- package/dist/templates/react-env/files/index.js +0 -1
- package/dist/templates/react-env/files/index.js.map +1 -1
- package/dist/templates/react-env/files/jest.config.js +0 -1
- package/dist/templates/react-env/files/jest.config.js.map +1 -1
- package/dist/templates/react-env/files/main.runtime.js +0 -1
- package/dist/templates/react-env/files/main.runtime.js.map +1 -1
- package/dist/templates/react-env/files/preview.runtime.js +0 -1
- package/dist/templates/react-env/files/preview.runtime.js.map +1 -1
- package/dist/templates/react-env/files/typescript/styles.js +0 -1
- package/dist/templates/react-env/files/typescript/styles.js.map +1 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js.map +1 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js +0 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js.map +1 -1
- package/dist/templates/react-env/files/webpack.config.js +0 -1
- package/dist/templates/react-env/files/webpack.config.js.map +1 -1
- package/dist/templates/react-env/index.js +0 -31
- package/dist/templates/react-env/index.js.map +1 -1
- package/dist/templates/react-hook/files/component.js +0 -2
- package/dist/templates/react-hook/files/component.js.map +1 -1
- package/dist/templates/react-hook/files/composition.js +0 -2
- package/dist/templates/react-hook/files/composition.js.map +1 -1
- package/dist/templates/react-hook/files/docs.js +0 -2
- package/dist/templates/react-hook/files/docs.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.js +0 -2
- package/dist/templates/react-hook/files/index-file.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.spec.js +0 -6
- package/dist/templates/react-hook/files/index-file.spec.js.map +1 -1
- package/dist/templates/react-hook/files/test.js +0 -2
- package/dist/templates/react-hook/files/test.js.map +1 -1
- package/dist/templates/react-hook/index.js +0 -16
- package/dist/templates/react-hook/index.js.map +1 -1
- package/dist/templates/react-workspace/index.js +2 -6
- package/dist/templates/react-workspace/index.js.map +1 -1
- package/dist/templates/react-workspace-analytics/index.js +0 -5
- package/dist/templates/react-workspace-analytics/index.js.map +1 -1
- package/dist/templates/react-workspace-app/index.js +2 -13
- package/dist/templates/react-workspace-app/index.js.map +1 -1
- package/dist/templates/react-workspace-blog/index.js +0 -5
- package/dist/templates/react-workspace-blog/index.js.map +1 -1
- package/dist/templates/react-workspace-data-fetching/index.js +0 -5
- package/dist/templates/react-workspace-data-fetching/index.js.map +1 -1
- package/dist/templates/react-workspace-deprecated/index.js +0 -5
- package/dist/templates/react-workspace-deprecated/index.js.map +1 -1
- package/dist/templates/react-workspace-design-system/index.js +0 -5
- package/dist/templates/react-workspace-design-system/index.js.map +1 -1
- package/dist/templates/react-workspace-lib/index.js +0 -5
- package/dist/templates/react-workspace-lib/index.js.map +1 -1
- package/dist/templates/react-workspace-wiki/index.js +0 -5
- package/dist/templates/react-workspace-wiki/index.js.map +1 -1
- package/dist/templates/workspace-common/constants.js.map +1 -1
- package/dist/templates/workspace-common/files/eslint-config.js.map +1 -1
- package/dist/templates/workspace-common/files/git-ignore.js +0 -1
- package/dist/templates/workspace-common/files/git-ignore.js.map +1 -1
- package/dist/templates/workspace-common/files/launch-json.js +0 -2
- package/dist/templates/workspace-common/files/launch-json.js.map +1 -1
- package/dist/templates/workspace-common/files/prettier-config.js.map +1 -1
- package/dist/templates/workspace-common/files/readme-file.js +0 -1
- package/dist/templates/workspace-common/files/readme-file.js.map +1 -1
- package/dist/templates/workspace-common/files/ts-config.js.map +1 -1
- package/dist/templates/workspace-common/files/types/asset.js.map +1 -1
- package/dist/templates/workspace-common/files/types/style.js.map +1 -1
- package/dist/templates/workspace-common/files/workspace-config.js +0 -14
- package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
- package/dist/templates/workspace-common/generate-files.js +0 -29
- package/dist/templates/workspace-common/generate-files.js.map +1 -1
- package/dist/templates/workspace-common/index.js +0 -3
- package/dist/templates/workspace-common/index.js.map +1 -1
- package/dist/webpack/html.js +3 -2
- package/dist/webpack/html.js.map +1 -1
- package/dist/webpack/index.js +0 -3
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/overlay/formatWebpackMessages.js +26 -37
- package/dist/webpack/overlay/formatWebpackMessages.js.map +1 -1
- package/dist/webpack/overlay/launchEditorEndpoint.js +2 -2
- package/dist/webpack/overlay/launchEditorEndpoint.js.map +1 -1
- package/dist/webpack/overlay/refreshOverlayInterop.js +1 -3
- package/dist/webpack/overlay/refreshOverlayInterop.js.map +1 -1
- package/dist/webpack/overlay/webpackHotDevClient.js +54 -71
- package/dist/webpack/overlay/webpackHotDevClient.js.map +1 -1
- package/dist/webpack/postcss.config.js +6 -3
- package/dist/webpack/postcss.config.js.map +1 -1
- package/dist/webpack/webpack.config.base.js +28 -53
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/dist/webpack/webpack.config.base.prod.js +10 -14
- package/dist/webpack/webpack.config.base.prod.js.map +1 -1
- package/dist/webpack/webpack.config.component.dev.js +10 -17
- package/dist/webpack/webpack.config.component.dev.js.map +1 -1
- package/dist/webpack/webpack.config.component.prod.js +3 -6
- package/dist/webpack/webpack.config.component.prod.js.map +1 -1
- package/dist/webpack/webpack.config.env.dev.js +5 -5
- package/dist/webpack/webpack.config.env.dev.js.map +1 -1
- package/dist/webpack/webpack.config.env.template.js +0 -1
- package/dist/webpack/webpack.config.env.template.js.map +1 -1
- package/{overview-1666409808293.js → overview-1666496165706.js} +0 -0
- package/package-tar/teambit-react-0.0.882.tgz +0 -0
- package/package.json +25 -25
- package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
- package/artifacts/env-template/public/peers.df1b33444b47cc9becfc.js +0 -1
- package/artifacts/env-template/public/static/css/238.a0238c25.css +0 -1
- package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
- package/package-tar/teambit-react-0.0.881.tgz +0 -0
|
@@ -8,4 +8,4 @@ It enables you to quickly set up a dev environment that follows best practices f
|
|
|
8
8
|
}
|
|
9
9
|
`)),(0,_react2.mdx)("h2",null,"Creating Components"),(0,_react2.mdx)("p",null,"React env provides a set of component templates that can be used to speed-up and standardize your component development:"),(0,_react2.mdx)("p",null,"To list all available templates:"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-bash"},`bit templates
|
|
10
10
|
`)),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react")," a basic React UI component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-context")," a react context component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-hook")," a react hook component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"mdx-component")," an MDX component."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-component-js")," a basic React component in JS."),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("inlineCode",{parentName:"li"},"react-env")," boilerplate for a customized environment configuration.")),(0,_react2.mdx)("p",null,"Use any of these templates with the ",(0,_react2.mdx)("inlineCode",{parentName:"p"},"bit create")," command:"),(0,_react2.mdx)("pre",null,(0,_react2.mdx)("code",{parentName:"pre",className:"language-bash"},`bit create react ui/my-welcome
|
|
11
|
-
`)),(0,_react2.mdx)("h2",null,"Development services and configurations"),(0,_react2.mdx)("p",null,"The table below lists ",(0,_react2.mdx)("a",{parentName:"p",href:"/dev-services/dev-services-overview"},"dev services")," that are provided by the React env. Each service handles a specific component development operation. Each is implemented by the React env, using a specific set of configurations."),(0,_react2.mdx)("p",null,"To customize and extend the React env, ",(0,_react2.mdx)("a",{parentName:"p",href:"/envs/pre-configured-envs/react/extending-react#using-your-own-react-env-extension"},"create you own React env extension"),". You can replace the Aspects used by the env, or override their configurations (use the links provided in the 'customization' column)."),(0,_react2.mdx)("table",null,(0,_react2.mdx)("thead",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"thead"},(0,_react2.mdx)("th",{parentName:"tr",align:null},"Service"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Default config"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Customization"))),(0,_react2.mdx)("tbody",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/compiler-overview"},"Compiler")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#typescript"},"TS compilation config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/configure-env-with-compiler"},"Replace compiler"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/tester/overview"},"Tester")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/jest"},"Jest")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#jest"},"Jest config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/tester/configure-env-with-tester"},"Replace Tester"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/linter/overview"},"Linting")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/eslint"},"ESLint")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#eslint"},"ESLint Config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/linter/configure-env-with-linter"},"Replace Linter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/formatter/overview"},"Formatter")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/prettier"},"Prettier")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/prettier/prettier.config.js"},"prettier.config.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#prettier"},"Prettier config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/formatter/configure-env-with-formatter"},"Replace Formatter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling in the workspace)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/preview/overview"},"Preview")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null}),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/preview/register-custom-preview"},"Add preview"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/packages/packages-overview"},"Package")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"See the ",(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect")," config"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/packages/managing-package-json#set-configuration-from-an-env"},"Add Env package config")," ",(0,_react2.mdx)("br",null)," \u2022 TypeScript's package config")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"Bundler"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling during build)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-overview"},"Documentation")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-templates"},"Replace docs template"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Builder")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Build pipeline")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/builder/build-pipelines"},"Build pipelines"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/dependencies-overview"},"Dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/react.env.ts"},"Env-dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/configuring-dependencies#configuring-dependencies-from-an-env"},"Env dependencies"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/generator/generator-overview"},"Generator")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/templates/react-component.ts"},"React templates")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:""},"Add a component template"))))),(0,_react2.mdx)("h3",null,"Default React versions"),(0,_react2.mdx)("p",null,"By default, the React env sets the following dependency versions for components using it:"),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react-dom")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.8")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react-dom"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.5")))))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},428:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/react@0.0.881",homepage:"https://bit.dev/teambit/react/react",exported:!0},_interopRequireDefault=__webpack_require__2(244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/react.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},57:module2=>{"use strict";module2.exports=MdxJsReact},804:module2=>{"use strict";module2.exports=React},459:module2=>{"use strict";module2.exports=TeambitMdxUiMdxScopeContext}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,compositions_metadata:()=>compositions_metadata,overview:()=>overview});var react_docs_namespaceObject={};__webpack_require__.r(react_docs_namespaceObject),__webpack_require__.d(react_docs_namespaceObject,{default:()=>MDXContent});var react_composition=__webpack_require__(428),external_React_=__webpack_require__(804),external_MdxJsReact_=__webpack_require__(57),external_TeambitMdxUiMdxScopeContext_=__webpack_require__(459),dist=__webpack_require__(906),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_.MDXScopeProvider,{components:{ReactOverview:dist.ZP},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.ZP,{mdxType:"ReactOverview"})))}MDXContent.isMDXComponent=!0;const compositions=[react_composition],overview=[react_docs_namespaceObject],compositions_metadata={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),__webpack_exports__})()});
|
|
11
|
+
`)),(0,_react2.mdx)("h2",null,"Development services and configurations"),(0,_react2.mdx)("p",null,"The table below lists ",(0,_react2.mdx)("a",{parentName:"p",href:"/dev-services/dev-services-overview"},"dev services")," that are provided by the React env. Each service handles a specific component development operation. Each is implemented by the React env, using a specific set of configurations."),(0,_react2.mdx)("p",null,"To customize and extend the React env, ",(0,_react2.mdx)("a",{parentName:"p",href:"/envs/pre-configured-envs/react/extending-react#using-your-own-react-env-extension"},"create you own React env extension"),". You can replace the Aspects used by the env, or override their configurations (use the links provided in the 'customization' column)."),(0,_react2.mdx)("table",null,(0,_react2.mdx)("thead",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"thead"},(0,_react2.mdx)("th",{parentName:"tr",align:null},"Service"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Aspect"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Default config"),(0,_react2.mdx)("th",{parentName:"tr",align:null},"Customization"))),(0,_react2.mdx)("tbody",{parentName:"table"},(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/compiler-overview"},"Compiler")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript"},"TypeScript")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/typescript/tsconfig.json"},"tsconfig.json")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#typescript"},"TS compilation config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/compiler/configure-env-with-compiler"},"Replace compiler"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/tester/overview"},"Tester")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/jest"},"Jest")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/jest/jest.config.js"},"jest.config.js")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#jest"},"Jest config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/tester/configure-env-with-tester"},"Replace Tester"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/linter/overview"},"Linting")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/eslint"},"ESLint")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/eslint/eslintrc.ts"},"eslintrc.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#eslint"},"ESLint Config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/linter/configure-env-with-linter"},"Replace Linter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/formatter/overview"},"Formatter")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/defender/prettier"},"Prettier")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/prettier/prettier.config.js"},"prettier.config.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/frameworks/react/config-react-tools#prettier"},"Prettier config")," ",(0,_react2.mdx)("br",null)," \u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/formatter/configure-env-with-formatter"},"Replace Formatter"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"DevServer"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.dev.ts"},"webpack.config.preview.dev.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling in the workspace)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/preview/overview"},"Preview")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null}),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/preview/register-custom-preview"},"Add preview"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/packages/packages-overview"},"Package")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"See the ",(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/typescript/typescript/~code/typescript.main.runtime.ts"},"TypeScript Aspect")," config"),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 ",(0,_react2.mdx)("a",{parentName:"td",href:"/packages/managing-package-json#set-configuration-from-an-env"},"Add Env package config")," ",(0,_react2.mdx)("br",null)," \u2022 TypeScript's package config")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},"Bundler"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/webpack/webpack"},"Webpack")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/webpack/webpack.config.preview.ts"},"webpack.config.preview.ts")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"\u2022 Webpack config (for bundling during build)")),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-overview"},"Documentation")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/docs/index.tsx"},"Docs template")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/docs/docs-templates"},"Replace docs template"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Builder")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"http://localhost:3000/docs/dev-services/builder/builder-overview"},"Build pipeline")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dev-services/builder/build-pipelines"},"Build pipelines"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/dependencies-overview"},"Dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/react.env.ts"},"Env-dependencies")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/dependencies/configuring-dependencies#configuring-dependencies-from-an-env"},"Env dependencies"))),(0,_react2.mdx)("tr",{parentName:"tbody"},(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"/docs/dev-services/generator/generator-overview"},"Generator")),(0,_react2.mdx)("td",{parentName:"tr",align:null},"-"),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:"https://bit.dev/teambit/react/react/~code/templates/react-component.ts"},"React templates")),(0,_react2.mdx)("td",{parentName:"tr",align:null},(0,_react2.mdx)("a",{parentName:"td",href:""},"Add a component template"))))),(0,_react2.mdx)("h3",null,"Default React versions"),(0,_react2.mdx)("p",null,"By default, the React env sets the following dependency versions for components using it:"),(0,_react2.mdx)("ul",null,(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"react-dom")," (peer dependency): ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^16.8.0 || ^17.0.0")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.8")),(0,_react2.mdx)("li",{parentName:"ul"},(0,_react2.mdx)("strong",{parentName:"li"},"@types/react-dom"),": ",(0,_react2.mdx)("inlineCode",{parentName:"li"},"^17.0.5")))))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},663:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.react/react@0.0.882",homepage:"https://bit.dev/teambit/react/react",exported:!0},_interopRequireDefault=__webpack_require__2(244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/react.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},57:module2=>{"use strict";module2.exports=MdxJsReact},804:module2=>{"use strict";module2.exports=React},459:module2=>{"use strict";module2.exports=TeambitMdxUiMdxScopeContext}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,compositions_metadata:()=>compositions_metadata,overview:()=>overview});var react_docs_namespaceObject={};__webpack_require__.r(react_docs_namespaceObject),__webpack_require__.d(react_docs_namespaceObject,{default:()=>MDXContent});var react_composition=__webpack_require__(663),external_React_=__webpack_require__(804),external_MdxJsReact_=__webpack_require__(57),external_TeambitMdxUiMdxScopeContext_=__webpack_require__(459),dist=__webpack_require__(906),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_.MDXScopeProvider,{components:{ReactOverview:dist.ZP},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.ZP,{mdxType:"ReactOverview"})))}MDXContent.isMDXComponent=!0;const compositions=[react_composition],overview=[react_docs_namespaceObject],compositions_metadata={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),__webpack_exports__})()});
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["computeResults","results","publicDir","ssrPublicDir","result","errors","warnings"],"sources":["compute-results.ts"],"sourcesContent":["import { BundlerResult } from '@teambit/bundler';\nimport { ReactAppBuildResult } from './react-build-result';\n\ntype resultsOptions = {\n publicDir: string;\n ssrPublicDir?: string;\n};\nexport async function computeResults(\n results: BundlerResult[],\n { publicDir, ssrPublicDir }: resultsOptions\n): Promise<ReactAppBuildResult> {\n const result = results[0];\n\n return {\n publicDir,\n ssrPublicDir,\n errors: result.errors,\n warnings: result.warnings,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["computeResults","results","publicDir","ssrPublicDir","result","errors","warnings"],"sources":["compute-results.ts"],"sourcesContent":["import { BundlerResult } from '@teambit/bundler';\nimport { ReactAppBuildResult } from './react-build-result';\n\ntype resultsOptions = {\n publicDir: string;\n ssrPublicDir?: string;\n};\nexport async function computeResults(\n results: BundlerResult[],\n { publicDir, ssrPublicDir }: resultsOptions\n): Promise<ReactAppBuildResult> {\n const result = results[0];\n\n return {\n publicDir,\n ssrPublicDir,\n errors: result.errors,\n warnings: result.warnings,\n };\n}\n"],"mappings":";;;;;;;AAOO,eAAeA,cAAc,CAClCC,OAAwB,EACxB;EAAEC,SAAS;EAAEC;AAA6B,CAAC,EACb;EAC9B,MAAMC,MAAM,GAAGH,OAAO,CAAC,CAAC,CAAC;EAEzB,OAAO;IACLC,SAAS;IACTC,YAAY;IACZE,MAAM,EAAED,MAAM,CAACC,MAAM;IACrBC,QAAQ,EAAEF,MAAM,CAACE;EACnB,CAAC;AACH"}
|
package/dist/apps/web/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ReactAppType } from './react.app-type';\nexport type { ReactDeployContext } from './deploy-context';\nexport type { ReactAppOptions } from './react-app-options';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ReactAppType } from './react.app-type';\nexport type { ReactDeployContext } from './deploy-context';\nexport type { ReactAppOptions } from './react-app-options';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -9,14 +9,11 @@ Object.defineProperty(exports, "prerenderPlugin", {
|
|
|
9
9
|
return _prerender().prerenderPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
function _prerender() {
|
|
14
13
|
const data = require("./prerender");
|
|
15
|
-
|
|
16
14
|
_prerender = function () {
|
|
17
15
|
return data;
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
return data;
|
|
21
18
|
}
|
|
22
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { prerenderPlugin } from './prerender';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { prerenderPlugin } from './prerender';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -1,52 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.prerenderPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _prerenderSpaPluginNext() {
|
|
21
16
|
const data = _interopRequireDefault(require("prerender-spa-plugin-next"));
|
|
22
|
-
|
|
23
17
|
_prerenderSpaPluginNext = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function _reactModules() {
|
|
31
23
|
const data = require("@teambit/react.modules.prerenderer-puppeteer");
|
|
32
|
-
|
|
33
24
|
_reactModules = function () {
|
|
34
25
|
return data;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return data;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
-
|
|
42
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
43
|
-
|
|
44
31
|
const prerenderPlugin = options => {
|
|
45
32
|
return new (_prerenderSpaPluginNext().default)(_objectSpread({
|
|
46
33
|
renderer: _reactModules().PuppeteerRenderer
|
|
47
34
|
}, options));
|
|
48
35
|
};
|
|
49
|
-
|
|
50
36
|
exports.prerenderPlugin = prerenderPlugin;
|
|
51
37
|
|
|
52
38
|
//# sourceMappingURL=prerender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["prerenderPlugin","options","PrerenderSPAPlugin","renderer","PuppeteerRenderer"],"sources":["prerender.ts"],"sourcesContent":["import PrerenderSPAPlugin from 'prerender-spa-plugin-next';\nimport { PuppeteerRenderer } from '@teambit/react.modules.prerenderer-puppeteer';\nimport { ReactAppPrerenderOptions } from '../react-app-options';\n\nexport const prerenderPlugin = (options: ReactAppPrerenderOptions) => {\n return new PrerenderSPAPlugin({\n renderer: PuppeteerRenderer,\n ...options,\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["prerenderPlugin","options","PrerenderSPAPlugin","renderer","PuppeteerRenderer"],"sources":["prerender.ts"],"sourcesContent":["import PrerenderSPAPlugin from 'prerender-spa-plugin-next';\nimport { PuppeteerRenderer } from '@teambit/react.modules.prerenderer-puppeteer';\nimport { ReactAppPrerenderOptions } from '../react-app-options';\n\nexport const prerenderPlugin = (options: ReactAppPrerenderOptions) => {\n return new PrerenderSPAPlugin({\n renderer: PuppeteerRenderer,\n ...options,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAiF;AAAA;AAG1E,MAAMA,eAAe,GAAIC,OAAiC,IAAK;EACpE,OAAO,KAAIC,iCAAkB;IAC3BC,QAAQ,EAAEC;EAAiB,GACxBH,OAAO,EACV;AACJ,CAAC;AAAC"}
|
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ReactAppType = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = require("./react.application");
|
|
10
|
-
|
|
11
9
|
_react = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
class ReactAppType {
|
|
19
15
|
constructor(name, reactEnv, logger, dependencyResolver) {
|
|
20
16
|
this.name = name;
|
|
@@ -22,13 +18,10 @@ class ReactAppType {
|
|
|
22
18
|
this.logger = logger;
|
|
23
19
|
this.dependencyResolver = dependencyResolver;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
createApp(options) {
|
|
27
22
|
return new (_react().ReactApp)(options.name, options.entry, options.ssr, options.portRange || [3000, 4000], this.reactEnv, this.logger, this.dependencyResolver, options.prerender, options.bundler, options.ssrBundler, options.devServer, options.webpackTransformers, options.deploy, options.favicon);
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
exports.ReactAppType = ReactAppType;
|
|
33
26
|
|
|
34
27
|
//# sourceMappingURL=react.app-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReactAppType","constructor","name","reactEnv","logger","dependencyResolver","createApp","options","ReactApp","entry","ssr","portRange","prerender","bundler","ssrBundler","devServer","webpackTransformers","deploy","favicon"],"sources":["react.app-type.ts"],"sourcesContent":["import type { Logger } from '@teambit/logger';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ApplicationType } from '@teambit/application';\nimport { ReactAppOptions } from './react-app-options';\nimport { ReactApp } from './react.application';\nimport { ReactEnv } from '../../react.env';\n\nexport class ReactAppType implements ApplicationType<ReactAppOptions> {\n constructor(\n readonly name: string,\n private reactEnv: ReactEnv,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain\n ) {}\n\n createApp(options: ReactAppOptions) {\n return new ReactApp(\n options.name,\n options.entry,\n options.ssr,\n options.portRange || [3000, 4000],\n this.reactEnv,\n this.logger,\n this.dependencyResolver,\n options.prerender,\n options.bundler,\n options.ssrBundler,\n options.devServer,\n options.webpackTransformers,\n options.deploy,\n options.favicon\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ReactAppType","constructor","name","reactEnv","logger","dependencyResolver","createApp","options","ReactApp","entry","ssr","portRange","prerender","bundler","ssrBundler","devServer","webpackTransformers","deploy","favicon"],"sources":["react.app-type.ts"],"sourcesContent":["import type { Logger } from '@teambit/logger';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ApplicationType } from '@teambit/application';\nimport { ReactAppOptions } from './react-app-options';\nimport { ReactApp } from './react.application';\nimport { ReactEnv } from '../../react.env';\n\nexport class ReactAppType implements ApplicationType<ReactAppOptions> {\n constructor(\n readonly name: string,\n private reactEnv: ReactEnv,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain\n ) {}\n\n createApp(options: ReactAppOptions) {\n return new ReactApp(\n options.name,\n options.entry,\n options.ssr,\n options.portRange || [3000, 4000],\n this.reactEnv,\n this.logger,\n this.dependencyResolver,\n options.prerender,\n options.bundler,\n options.ssrBundler,\n options.devServer,\n options.webpackTransformers,\n options.deploy,\n options.favicon\n );\n }\n}\n"],"mappings":";;;;;;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,YAAY,CAA6C;EACpEC,WAAW,CACAC,IAAY,EACbC,QAAkB,EAClBC,MAAc,EACdC,kBAA0C,EAClD;IAAA,KAJSH,IAAY,GAAZA,IAAY;IAAA,KACbC,QAAkB,GAAlBA,QAAkB;IAAA,KAClBC,MAAc,GAAdA,MAAc;IAAA,KACdC,kBAA0C,GAA1CA,kBAA0C;EACjD;EAEHC,SAAS,CAACC,OAAwB,EAAE;IAClC,OAAO,KAAIC,iBAAQ,EACjBD,OAAO,CAACL,IAAI,EACZK,OAAO,CAACE,KAAK,EACbF,OAAO,CAACG,GAAG,EACXH,OAAO,CAACI,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EACjC,IAAI,CAACR,QAAQ,EACb,IAAI,CAACC,MAAM,EACX,IAAI,CAACC,kBAAkB,EACvBE,OAAO,CAACK,SAAS,EACjBL,OAAO,CAACM,OAAO,EACfN,OAAO,CAACO,UAAU,EAClBP,OAAO,CAACQ,SAAS,EACjBR,OAAO,CAACS,mBAAmB,EAC3BT,OAAO,CAACU,MAAM,EACdV,OAAO,CAACW,OAAO,CAChB;EACH;AACF;AAAC"}
|
|
@@ -1,160 +1,112 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.ReactApp = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _fs() {
|
|
25
18
|
const data = require("fs");
|
|
26
|
-
|
|
27
19
|
_fs = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _path() {
|
|
35
25
|
const data = require("path");
|
|
36
|
-
|
|
37
26
|
_path = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _toolboxNetwork() {
|
|
45
32
|
const data = require("@teambit/toolbox.network.get-port");
|
|
46
|
-
|
|
47
33
|
_toolboxNetwork = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _component() {
|
|
55
39
|
const data = require("@teambit/component");
|
|
56
|
-
|
|
57
40
|
_component = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
function _dependencyResolver() {
|
|
65
46
|
const data = require("@teambit/dependency-resolver");
|
|
66
|
-
|
|
67
47
|
_dependencyResolver = function () {
|
|
68
48
|
return data;
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
return data;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
function _lodash() {
|
|
75
53
|
const data = _interopRequireDefault(require("lodash.compact"));
|
|
76
|
-
|
|
77
54
|
_lodash = function () {
|
|
78
55
|
return data;
|
|
79
56
|
};
|
|
80
|
-
|
|
81
57
|
return data;
|
|
82
58
|
}
|
|
83
|
-
|
|
84
59
|
function _bitError() {
|
|
85
60
|
const data = require("@teambit/bit-error");
|
|
86
|
-
|
|
87
61
|
_bitError = function () {
|
|
88
62
|
return data;
|
|
89
63
|
};
|
|
90
|
-
|
|
91
64
|
return data;
|
|
92
65
|
}
|
|
93
|
-
|
|
94
66
|
function _plugins() {
|
|
95
67
|
const data = require("./plugins");
|
|
96
|
-
|
|
97
68
|
_plugins = function () {
|
|
98
69
|
return data;
|
|
99
70
|
};
|
|
100
|
-
|
|
101
71
|
return data;
|
|
102
72
|
}
|
|
103
|
-
|
|
104
73
|
function _webpack() {
|
|
105
74
|
const data = require("../../webpack");
|
|
106
|
-
|
|
107
75
|
_webpack = function () {
|
|
108
76
|
return data;
|
|
109
77
|
};
|
|
110
|
-
|
|
111
78
|
return data;
|
|
112
79
|
}
|
|
113
|
-
|
|
114
80
|
function _computeResults() {
|
|
115
81
|
const data = require("./compute-results");
|
|
116
|
-
|
|
117
82
|
_computeResults = function () {
|
|
118
83
|
return data;
|
|
119
84
|
};
|
|
120
|
-
|
|
121
85
|
return data;
|
|
122
86
|
}
|
|
123
|
-
|
|
124
87
|
function _webpackAppSsr() {
|
|
125
88
|
const data = require("./webpack/webpack.app.ssr.config");
|
|
126
|
-
|
|
127
89
|
_webpackAppSsr = function () {
|
|
128
90
|
return data;
|
|
129
91
|
};
|
|
130
|
-
|
|
131
92
|
return data;
|
|
132
93
|
}
|
|
133
|
-
|
|
134
94
|
function _mutators() {
|
|
135
95
|
const data = require("./webpack/mutators");
|
|
136
|
-
|
|
137
96
|
_mutators = function () {
|
|
138
97
|
return data;
|
|
139
98
|
};
|
|
140
|
-
|
|
141
99
|
return data;
|
|
142
100
|
}
|
|
143
|
-
|
|
144
101
|
function _ssrExpress() {
|
|
145
102
|
const data = require("./ssr/ssr-express");
|
|
146
|
-
|
|
147
103
|
_ssrExpress = function () {
|
|
148
104
|
return data;
|
|
149
105
|
};
|
|
150
|
-
|
|
151
106
|
return data;
|
|
152
107
|
}
|
|
153
|
-
|
|
154
108
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
155
|
-
|
|
156
109
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
157
|
-
|
|
158
110
|
class ReactApp {
|
|
159
111
|
constructor(name, entry, ssr, portRange, reactEnv, logger, dependencyResolver, prerender, bundler, ssrBundler, devServer, transformers = [], deploy, favicon) {
|
|
160
112
|
this.name = name;
|
|
@@ -175,40 +127,38 @@ class ReactApp {
|
|
|
175
127
|
(0, _defineProperty2().default)(this, "dir", 'public');
|
|
176
128
|
(0, _defineProperty2().default)(this, "ssrDir", 'ssr');
|
|
177
129
|
}
|
|
178
|
-
|
|
179
130
|
async run(context) {
|
|
180
131
|
const [from, to] = this.portRange;
|
|
181
132
|
const port = await _toolboxNetwork().Port.getPort(from, to);
|
|
182
|
-
|
|
183
133
|
if (this.devServer) {
|
|
184
134
|
await this.devServer.listen(port);
|
|
185
135
|
return port;
|
|
186
136
|
}
|
|
187
|
-
|
|
188
137
|
const devServerContext = await this.getDevServerContext(context);
|
|
189
138
|
const devServer = this.reactEnv.getDevServer(devServerContext, [_mutators().addDevServer, _mutators().setOutput, ...this.transformers]);
|
|
190
139
|
await devServer.listen(port);
|
|
191
140
|
return port;
|
|
192
141
|
}
|
|
193
|
-
|
|
194
142
|
async runSsr(context) {
|
|
195
143
|
var _this$logger, _this$logger2, _this$logger3;
|
|
196
|
-
|
|
197
144
|
const [from, to] = this.portRange;
|
|
198
|
-
const port = await _toolboxNetwork().Port.getPort(from, to);
|
|
145
|
+
const port = await _toolboxNetwork().Port.getPort(from, to);
|
|
199
146
|
|
|
147
|
+
// bundle client
|
|
200
148
|
const clientBundle = await this.buildClient(context);
|
|
201
149
|
if (clientBundle.errors.length > 0) return {
|
|
202
150
|
errors: clientBundle.errors
|
|
203
151
|
};
|
|
204
|
-
(_this$logger = this.logger) === null || _this$logger === void 0 ? void 0 : _this$logger.info('[react.application] [ssr] client bundle - complete');
|
|
152
|
+
(_this$logger = this.logger) === null || _this$logger === void 0 ? void 0 : _this$logger.info('[react.application] [ssr] client bundle - complete');
|
|
205
153
|
|
|
154
|
+
// bundle server
|
|
206
155
|
const serverBundle = await this.buildSsr(context);
|
|
207
156
|
if (serverBundle.errors.length > 0) return {
|
|
208
157
|
errors: serverBundle.errors
|
|
209
158
|
};
|
|
210
|
-
(_this$logger2 = this.logger) === null || _this$logger2 === void 0 ? void 0 : _this$logger2.info('[react.application] [ssr] server bundle - complete');
|
|
159
|
+
(_this$logger2 = this.logger) === null || _this$logger2 === void 0 ? void 0 : _this$logger2.info('[react.application] [ssr] server bundle - complete');
|
|
211
160
|
|
|
161
|
+
// load server-side runtime
|
|
212
162
|
const app = await (0, _ssrExpress().loadSsrApp)(context.workdir, context.appName);
|
|
213
163
|
(_this$logger3 = this.logger) === null || _this$logger3 === void 0 ? void 0 : _this$logger3.info('[react.application] [ssr] bundle code - loaded');
|
|
214
164
|
const expressApp = (0, _ssrExpress().createExpressSsr)({
|
|
@@ -224,15 +174,15 @@ class ReactApp {
|
|
|
224
174
|
port
|
|
225
175
|
};
|
|
226
176
|
}
|
|
227
|
-
|
|
228
177
|
async buildClient(context) {
|
|
229
178
|
const htmlConfig = [{
|
|
230
179
|
title: context.appName,
|
|
231
180
|
templateContent: (0, _webpack().html)(context.appName),
|
|
232
181
|
minify: false,
|
|
233
182
|
favicon: this.favicon
|
|
234
|
-
}];
|
|
183
|
+
}];
|
|
235
184
|
|
|
185
|
+
// extend, including prototype methods
|
|
236
186
|
const ctx = Object.assign(Object.create(context), {
|
|
237
187
|
html: htmlConfig,
|
|
238
188
|
targets: [{
|
|
@@ -250,7 +200,6 @@ class ReactApp {
|
|
|
250
200
|
const bundleResult = await bundler.run();
|
|
251
201
|
return bundleResult[0];
|
|
252
202
|
}
|
|
253
|
-
|
|
254
203
|
async buildSsr(context) {
|
|
255
204
|
// extend, including prototype methods
|
|
256
205
|
const ctx = Object.assign(Object.create(context), _objectSpread(_objectSpread({}, context), {}, {
|
|
@@ -269,15 +218,15 @@ class ReactApp {
|
|
|
269
218
|
const bundleResult = await bundler.run();
|
|
270
219
|
return bundleResult[0];
|
|
271
220
|
}
|
|
272
|
-
|
|
273
221
|
async build(context) {
|
|
274
222
|
const htmlConfig = [{
|
|
275
223
|
title: context.name,
|
|
276
224
|
templateContent: (0, _webpack().html)(context.name),
|
|
277
225
|
minify: false,
|
|
278
|
-
favicon: this.favicon
|
|
279
|
-
|
|
226
|
+
favicon: this.favicon
|
|
227
|
+
// filename: ''.html`,
|
|
280
228
|
}];
|
|
229
|
+
|
|
281
230
|
Object.assign(context, {
|
|
282
231
|
html: htmlConfig
|
|
283
232
|
});
|
|
@@ -290,7 +239,6 @@ class ReactApp {
|
|
|
290
239
|
ssrPublicDir: ssrAppDir
|
|
291
240
|
});
|
|
292
241
|
}
|
|
293
|
-
|
|
294
242
|
async buildSsrApp(context, ssrAppDir) {
|
|
295
243
|
const ssrBundler = await this.getSsrBundler(context);
|
|
296
244
|
await ssrBundler.run();
|
|
@@ -305,7 +253,6 @@ class ReactApp {
|
|
|
305
253
|
await installer.install(capsuleSsrDir, this.getSsrPolicy(), new (_component().ComponentMap)(new Map()));
|
|
306
254
|
return ssrAppDir;
|
|
307
255
|
}
|
|
308
|
-
|
|
309
256
|
getSsrPolicy() {
|
|
310
257
|
const workspacePolicy = new (_dependencyResolver().WorkspacePolicy)([]);
|
|
311
258
|
workspacePolicy.add({
|
|
@@ -345,17 +292,14 @@ class ReactApp {
|
|
|
345
292
|
});
|
|
346
293
|
return workspacePolicy;
|
|
347
294
|
}
|
|
348
|
-
|
|
349
295
|
getBundler(context) {
|
|
350
296
|
if (this.bundler) return this.bundler;
|
|
351
297
|
return this.getDefaultBundler(context);
|
|
352
298
|
}
|
|
353
|
-
|
|
354
299
|
getSsrBundler(context) {
|
|
355
300
|
if (this.ssrBundler) return this.ssrBundler;
|
|
356
301
|
return this.getDefaultSsrBundler(context);
|
|
357
302
|
}
|
|
358
|
-
|
|
359
303
|
async getDefaultBundler(context) {
|
|
360
304
|
const {
|
|
361
305
|
capsule
|
|
@@ -377,7 +321,6 @@ class ReactApp {
|
|
|
377
321
|
const bundler = await reactEnv.getBundler(bundlerContext, transformers);
|
|
378
322
|
return bundler;
|
|
379
323
|
}
|
|
380
|
-
|
|
381
324
|
async getDefaultSsrBundler(context) {
|
|
382
325
|
const {
|
|
383
326
|
capsule
|
|
@@ -396,7 +339,6 @@ class ReactApp {
|
|
|
396
339
|
const bundler = await reactEnv.getBundler(bundlerContext, transformers);
|
|
397
340
|
return bundler;
|
|
398
341
|
}
|
|
399
|
-
|
|
400
342
|
async getBuildContext(context, {
|
|
401
343
|
outputPath
|
|
402
344
|
}) {
|
|
@@ -427,22 +369,18 @@ class ReactApp {
|
|
|
427
369
|
});
|
|
428
370
|
return bundlerContext;
|
|
429
371
|
}
|
|
430
|
-
|
|
431
372
|
getPublicDir(artifactsDir) {
|
|
432
373
|
return (0, _path().join)(artifactsDir, this.applicationType, this.name);
|
|
433
374
|
}
|
|
434
|
-
|
|
435
375
|
async getEntries(path) {
|
|
436
376
|
if (Array.isArray(this.entry)) return this.entry;
|
|
437
377
|
return this.entry(path);
|
|
438
378
|
}
|
|
439
|
-
|
|
440
379
|
async getSsrEntries() {
|
|
441
380
|
if (!this.ssr) throw new (_bitError().BitError)('tried to build ssr without ssr entries');
|
|
442
381
|
if (typeof this.ssr === 'string') return [this.ssr];
|
|
443
382
|
return [await this.ssr()];
|
|
444
383
|
}
|
|
445
|
-
|
|
446
384
|
async getDevServerContext(context) {
|
|
447
385
|
const entries = await this.getEntries();
|
|
448
386
|
return Object.assign(context, {
|
|
@@ -455,13 +393,10 @@ class ReactApp {
|
|
|
455
393
|
aliasHostDependencies: true
|
|
456
394
|
});
|
|
457
395
|
}
|
|
458
|
-
|
|
459
396
|
getPeers() {
|
|
460
397
|
return this.reactEnv.getPeerDependenciesList();
|
|
461
398
|
}
|
|
462
|
-
|
|
463
399
|
}
|
|
464
|
-
|
|
465
400
|
exports.ReactApp = ReactApp;
|
|
466
401
|
|
|
467
402
|
//# sourceMappingURL=react.application.js.map
|