@teambit/react 0.0.777 → 0.0.780
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/apps/web/react.application.ts +3 -0
- package/artifacts/__bit_junit.xml +6 -0
- package/artifacts/env-template/public/22.df5dcfd6ec82b80f43f1.js +43 -0
- package/artifacts/env-template/public/{peers.9e37920084e4feaffe21.js → 244.40a7c02382995372607b.js} +8 -8
- package/artifacts/env-template/public/{830.js → 970.c5cde96c68e8fb444a24.js} +94 -92
- package/artifacts/env-template/public/assets-manifest.json +16 -14
- package/artifacts/env-template/public/{compositions.9d5376d2bee8aea2628c.js → compositions.7f9b3c1d5594a2b8356d.js} +2 -2
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/overview.9f2f451ee3e901539ae2.js +1 -0
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/peers.a454763fe05a7215f7c5.js +1 -0
- package/artifacts/env-template/public/preview-root.f0685d3de3c57905ba12.js +5 -0
- package/artifacts/env-template/public/static/css/{830.c01819bb.css → 970.c0eadd42.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1656732493790.js → compositions-1657039361770.js} +0 -1
- package/dist/apps/web/react.application.js +4 -1
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/react.env.js +12 -1
- package/dist/react.env.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.js +1 -1
- package/dist/templates/react-hook/files/index-file.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.spec.d.ts +1 -0
- package/dist/templates/react-hook/files/index-file.spec.js +41 -0
- package/dist/templates/react-hook/files/index-file.spec.js.map +1 -0
- package/dist/webpack/webpack.config.base.js +0 -3
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/dist/webpack/webpack.config.env.template.d.ts +2 -0
- package/dist/webpack/webpack.config.env.template.js +22 -0
- package/dist/webpack/webpack.config.env.template.js.map +1 -0
- package/{overview-1656732493790.js → overview-1657039361770.js} +0 -1
- package/package-tar/teambit-react-0.0.780.tgz +0 -0
- package/package.json +34 -34
- package/peers-link.12da65a556b208dcb44e12e06e145839e9b3df37.js +26 -0
- package/{preview-1656732493790.js → preview-1657039361770.js} +3 -3
- package/templates/react-hook/files/index-file.spec.ts +23 -0
- package/templates/react-hook/files/index-file.ts +1 -1
- package/webpack/webpack.config.base.ts +0 -4
- package/webpack/webpack.config.env.template.ts +15 -0
- package/artifacts/env-template/public/22.js +0 -43
- package/artifacts/env-template/public/overview.dc55bfaf3c3f448d6251.js +0 -1
- package/artifacts/env-template/public/preview-root.3e2209e9ea4939581c1a.js +0 -5
- package/package-tar/teambit-react-0.0.777.tgz +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.templateWebpackConfigFactory = templateWebpackConfigFactory;
|
|
7
|
+
|
|
8
|
+
function templateWebpackConfigFactory() {
|
|
9
|
+
return {
|
|
10
|
+
name: 'react.env-template',
|
|
11
|
+
output: {
|
|
12
|
+
filename: '[name].[chunkhash].js',
|
|
13
|
+
// might run into this error, when running multiple chunks created by different webpack builds:
|
|
14
|
+
// "Uncaught TypeError: __webpack_require__.n is not a function"
|
|
15
|
+
// this is because each build creates its own runtime, and they compete on the same global name.
|
|
16
|
+
// setting a separate global name for the template ensures it will not conflict with preview chunks loaded in runtime
|
|
17
|
+
chunkLoadingGlobal: '__loadChunks_EnvTemplate'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=webpack.config.env.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["templateWebpackConfigFactory","name","output","filename","chunkLoadingGlobal"],"sources":["webpack.config.env.template.ts"],"sourcesContent":["import { Configuration } from 'webpack';\n\nexport function templateWebpackConfigFactory(): Configuration {\n return {\n name: 'react.env-template',\n output: {\n filename: '[name].[chunkhash].js',\n // might run into this error, when running multiple chunks created by different webpack builds:\n // \"Uncaught TypeError: __webpack_require__.n is not a function\"\n // this is because each build creates its own runtime, and they compete on the same global name.\n // setting a separate global name for the template ensures it will not conflict with preview chunks loaded in runtime\n chunkLoadingGlobal: '__loadChunks_EnvTemplate',\n },\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,4BAAT,GAAuD;EAC5D,OAAO;IACLC,IAAI,EAAE,oBADD;IAELC,MAAM,EAAE;MACNC,QAAQ,EAAE,uBADJ;MAEN;MACA;MACA;MACA;MACAC,kBAAkB,EAAE;IANd;EAFH,CAAP;AAWD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { linkModules } from '/home/circleci/bit/bit/node_modules/@teambit/preview/dist/preview.preview.runtime.js';
|
|
3
|
-
import harmony from '/home/circleci/bit/bit/node_modules/@teambit/harmony/dist/index.js';
|
|
4
3
|
import * as mainModule from '/home/circleci/bit/bit/node_modules/@teambit/react.ui.docs-app/dist/index.js';
|
|
5
4
|
|
|
6
5
|
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.780",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/react/react",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.react",
|
|
8
8
|
"name": "react",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.780"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"react-error-boundary": "^3.0.0",
|
|
@@ -79,40 +79,40 @@
|
|
|
79
79
|
"@teambit/harmony": "0.3.3",
|
|
80
80
|
"@teambit/react.instructions.react.adding-compositions": "0.0.6",
|
|
81
81
|
"@teambit/react.instructions.react.adding-tests": "0.0.6",
|
|
82
|
-
"@teambit/design.ui.pages.standalone-not-found-page": "0.0.
|
|
83
|
-
"@teambit/preview": "0.0.
|
|
82
|
+
"@teambit/design.ui.pages.standalone-not-found-page": "0.0.359",
|
|
83
|
+
"@teambit/preview": "0.0.780",
|
|
84
84
|
"@teambit/react.ui.error-fallback": "0.0.111",
|
|
85
|
-
"@teambit/react.ui.loader-fallback": "0.0.
|
|
85
|
+
"@teambit/react.ui.loader-fallback": "0.0.90",
|
|
86
86
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
87
87
|
"@teambit/design.ui.tooltip": "0.0.352",
|
|
88
|
-
"@teambit/builder": "0.0.
|
|
89
|
-
"@teambit/bundler": "0.0.
|
|
90
|
-
"@teambit/compiler": "0.0.
|
|
91
|
-
"@teambit/component.modules.component-url": "0.0.
|
|
92
|
-
"@teambit/component": "0.0.
|
|
93
|
-
"@teambit/dependency-resolver": "0.0.
|
|
94
|
-
"@teambit/envs": "0.0.
|
|
95
|
-
"@teambit/eslint": "0.0.
|
|
96
|
-
"@teambit/formatter": "0.0.
|
|
97
|
-
"@teambit/jest": "0.0.
|
|
98
|
-
"@teambit/linter": "0.0.
|
|
99
|
-
"@teambit/logger": "0.0.
|
|
100
|
-
"@teambit/pkg": "0.0.
|
|
101
|
-
"@teambit/prettier": "0.0.
|
|
88
|
+
"@teambit/builder": "0.0.780",
|
|
89
|
+
"@teambit/bundler": "0.0.780",
|
|
90
|
+
"@teambit/compiler": "0.0.780",
|
|
91
|
+
"@teambit/component.modules.component-url": "0.0.125",
|
|
92
|
+
"@teambit/component": "0.0.780",
|
|
93
|
+
"@teambit/dependency-resolver": "0.0.780",
|
|
94
|
+
"@teambit/envs": "0.0.780",
|
|
95
|
+
"@teambit/eslint": "0.0.780",
|
|
96
|
+
"@teambit/formatter": "0.0.331",
|
|
97
|
+
"@teambit/jest": "0.0.780",
|
|
98
|
+
"@teambit/linter": "0.0.780",
|
|
99
|
+
"@teambit/logger": "0.0.609",
|
|
100
|
+
"@teambit/pkg": "0.0.780",
|
|
101
|
+
"@teambit/prettier": "0.0.331",
|
|
102
102
|
"@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
|
|
103
|
-
"@teambit/schema": "0.0.
|
|
104
|
-
"@teambit/tester": "0.0.
|
|
105
|
-
"@teambit/typescript": "0.0.
|
|
106
|
-
"@teambit/webpack": "0.0.
|
|
107
|
-
"@teambit/workspace": "0.0.
|
|
108
|
-
"@teambit/application": "0.0.
|
|
109
|
-
"@teambit/cli": "0.0.
|
|
110
|
-
"@teambit/generator": "0.0.
|
|
111
|
-
"@teambit/graphql": "0.0.
|
|
103
|
+
"@teambit/schema": "0.0.780",
|
|
104
|
+
"@teambit/tester": "0.0.780",
|
|
105
|
+
"@teambit/typescript": "0.0.780",
|
|
106
|
+
"@teambit/webpack": "0.0.780",
|
|
107
|
+
"@teambit/workspace": "0.0.780",
|
|
108
|
+
"@teambit/application": "0.0.422",
|
|
109
|
+
"@teambit/cli": "0.0.516",
|
|
110
|
+
"@teambit/generator": "0.0.780",
|
|
111
|
+
"@teambit/graphql": "0.0.780",
|
|
112
112
|
"@teambit/react.ui.highlighter-provider": "0.0.189",
|
|
113
|
-
"@teambit/compositions": "0.0.
|
|
114
|
-
"@teambit/ui": "0.0.
|
|
115
|
-
"@teambit/react.eslint-config-bit-react": "0.0.
|
|
113
|
+
"@teambit/compositions": "0.0.780",
|
|
114
|
+
"@teambit/ui": "0.0.780",
|
|
115
|
+
"@teambit/react.eslint-config-bit-react": "0.0.590",
|
|
116
116
|
"@teambit/mdx.modules.mdx-loader": "0.0.490",
|
|
117
117
|
"@teambit/react.babel.bit-react-transformer": "0.0.501",
|
|
118
118
|
"@teambit/webpack.modules.generate-style-loaders": "0.0.103",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@teambit/component-id": "0.0.402",
|
|
121
121
|
"@teambit/toolbox.network.get-port": "0.0.113",
|
|
122
122
|
"@teambit/react.modules.prerenderer-puppeteer": "0.0.2",
|
|
123
|
-
"@teambit/config": "0.0.
|
|
123
|
+
"@teambit/config": "0.0.529"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
126
|
"@types/react": "^17.0.8",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"@teambit/react.content.react-overview": "1.95.0"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
|
-
"@teambit/legacy": "1.0.
|
|
142
|
+
"@teambit/legacy": "1.0.297",
|
|
143
143
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
144
144
|
"react": "^16.8.0 || ^17.0.0"
|
|
145
145
|
},
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"@types/jest": "^26.0.0"
|
|
204
204
|
},
|
|
205
205
|
"peerDependencies": {
|
|
206
|
-
"@teambit/legacy": "1.0.
|
|
206
|
+
"@teambit/legacy": "1.0.297",
|
|
207
207
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
208
208
|
"react": "^16.8.0 || ^17.0.0"
|
|
209
209
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ReactDom from "react-dom";
|
|
4
|
+
import * as TeambitMdxUiMdxScopeContext from "@teambit/mdx.ui.mdx-scope-context";
|
|
5
|
+
import * as MdxJsReact from "@mdx-js/react";
|
|
6
|
+
|
|
7
|
+
const globalObj = window;
|
|
8
|
+
|
|
9
|
+
guard("React", React);
|
|
10
|
+
guard("ReactDom", ReactDom);
|
|
11
|
+
guard("TeambitMdxUiMdxScopeContext", TeambitMdxUiMdxScopeContext);
|
|
12
|
+
guard("MdxJsReact", MdxJsReact);
|
|
13
|
+
|
|
14
|
+
globalObj["React"] = React;
|
|
15
|
+
globalObj["ReactDom"] = ReactDom;
|
|
16
|
+
globalObj["TeambitMdxUiMdxScopeContext"] = TeambitMdxUiMdxScopeContext;
|
|
17
|
+
globalObj["MdxJsReact"] = MdxJsReact;
|
|
18
|
+
|
|
19
|
+
function guard(property, expected) {
|
|
20
|
+
var existing = globalObj[property];
|
|
21
|
+
|
|
22
|
+
if (existing === expected && expected !== undefined)
|
|
23
|
+
console.warn('[expose-peers] "' + property + '" already exists in global scope, but with correct value');
|
|
24
|
+
else if (existing !== undefined)
|
|
25
|
+
throw new Error('[expose-peers] "' + property + '" already exists in the global scope, cannot overwrite');
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.780/dist/react.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.780/dist/react.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
|
-
export const overview = [overview_0]
|
|
5
|
+
export const overview = [overview_0];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentID } from '@teambit/component-id';
|
|
2
|
+
import type { ComponentContext } from '@teambit/generator';
|
|
3
|
+
import { indexFile } from './index-file';
|
|
4
|
+
|
|
5
|
+
// react hook convention is `useX` (lowercase "use")
|
|
6
|
+
// it is required to enable hook-specific linting rules
|
|
7
|
+
const useFoobarSnapshot = `export { useFooBar } from './use-foo-bar';
|
|
8
|
+
`; // trailing line break
|
|
9
|
+
|
|
10
|
+
describe('templates: react-hook, index-file', () => {
|
|
11
|
+
it('should match snapshot', () => {
|
|
12
|
+
const ctx: ComponentContext = {
|
|
13
|
+
name: 'use-foo-bar',
|
|
14
|
+
namePascalCase: 'UseFooBar',
|
|
15
|
+
nameCamelCase: 'useFooBar',
|
|
16
|
+
componentId: ComponentID.fromString('baz.qux/use/foo/bar'),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const result = indexFile(ctx);
|
|
20
|
+
|
|
21
|
+
expect(result.content).toEqual(useFoobarSnapshot);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -72,10 +72,6 @@ export default function (isEnvProduction = false): Configuration {
|
|
|
72
72
|
alias: {
|
|
73
73
|
'react/jsx-dev-runtime': require.resolve('react/jsx-dev-runtime.js'),
|
|
74
74
|
'react/jsx-runtime': require.resolve('react/jsx-runtime.js'),
|
|
75
|
-
// Support React Native Web
|
|
76
|
-
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
|
|
77
|
-
// TODO: @uri please remember to remove after publishing evangelist and base-ui
|
|
78
|
-
|
|
79
75
|
'react-dom/server': require.resolve('react-dom/server'),
|
|
80
76
|
// Allows for better profiling with ReactDevTools
|
|
81
77
|
...(isEnvProductionProfile && {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Configuration } from 'webpack';
|
|
2
|
+
|
|
3
|
+
export function templateWebpackConfigFactory(): Configuration {
|
|
4
|
+
return {
|
|
5
|
+
name: 'react.env-template',
|
|
6
|
+
output: {
|
|
7
|
+
filename: '[name].[chunkhash].js',
|
|
8
|
+
// might run into this error, when running multiple chunks created by different webpack builds:
|
|
9
|
+
// "Uncaught TypeError: __webpack_require__.n is not a function"
|
|
10
|
+
// this is because each build creates its own runtime, and they compete on the same global name.
|
|
11
|
+
// setting a separate global name for the template ensures it will not conflict with preview chunks loaded in runtime
|
|
12
|
+
chunkLoadingGlobal: '__loadChunks_EnvTemplate',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|