Skip to content

Commit

Permalink
Declare tslib dependency (microsoft#1085)
Browse files Browse the repository at this point in the history
Fixes microsoft#1025

### Platforms Impacted
- [ ] iOS
- [ ] macOS
- [ ] win32 (Office)
- [ ] windows
- [ ] android

### Description of changes

Declare tslib dependency where tslib is used and we have importHelpers in tsconfig.ts in our framework package. Version of tslib is ^1.13.0 as that's the latest release that's supported due to our current typescript version (we need 3.9 or above to bump to 2.0 or later)

Also took the opportunity to use importHelpers in other packages that could use it, specifically for spreadArray so that is saves on bundle size. But if that change isn't desired, I can undo the last two commits and just fix the existing importHeaders

### Verification

Change builds, verifying that the bundle works properly on win32 and windows.

| Before                                       | After                                      |
|----------------------------------------------|--------------------------------------------|
| Screenshot or description before this change | Screenshot or description with this change |

### Pull request checklist

This PR has considered (when applicable):
- [ ] Automated Tests
- [ ] Documentation and examples
- [ ] Keyboard Accessibility
- [ ] Voiceover
- [ ] Internationalization and Right-to-left Layouts
  • Loading branch information
rurikoaraki authored Oct 25, 2021
1 parent d4016c3 commit f657874
Show file tree
Hide file tree
Showing 54 changed files with 182 additions and 29 deletions.
3 changes: 2 additions & 1 deletion apps/fluent-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"@fluentui/react-native": ">=0.26.5 <1.0.0",
"@react-native-community/slider": "^3.0.3",
"@react-native-menu/menu": "^0.1.2",
"@react-native-picker/picker": "^1.16.7"
"@react-native-picker/picker": "^1.16.7",
"tslib": "^1.13.0"
},
"devDependencies": {
"@rnx-kit/cli": "^0.5.27",
Expand Down
1 change: 1 addition & 0 deletions apps/fluent-tester/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"importHelpers": true,
"outDir": "lib",
"paths": {
"*": ["*", "*.win32", "./*"],
Expand Down
3 changes: 2 additions & 1 deletion apps/win32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"@fluentui-react-native/tester": "^0.45.1",
"react": "16.13.1",
"react-native": "^0.63.2",
"react-native-svg": "^12.1.1"
"react-native-svg": "^12.1.1",
"tslib": "^1.13.0"
},
"devDependencies": {
"@office-iss/react-native-win32": "^0.63.7",
Expand Down
1 change: 1 addition & 0 deletions apps/win32/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"importHelpers": true,
"paths": {
"*": ["*", "*.win32"],
"src/*": ["./src/*"]
Expand Down
3 changes: 2 additions & 1 deletion apps/windows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"react": "16.13.1",
"react-native": "^0.63.2",
"react-native-svg": "^12.1.1",
"react-native-windows": "^0.64.0"
"react-native-windows": "^0.64.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@babel/core": "^7.6.2",
Expand Down
1 change: 1 addition & 0 deletions apps/windows/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"importHelpers": true,
"paths": {
"*": ["*", "*.win32"],
"src/*": ["./src/*"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/experimental-button",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/experimental-checkbox",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/experimental-tabs",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/experimental-text",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix dependency",
"packageName": "@fluentui-react-native/framework",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/immutable-merge",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/interactive-hooks",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/memo-cache",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/merge-props",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/tester",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/tester-win32",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/tokens",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/use-slot",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/use-styling",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/use-tokens",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use tslib where spreadArray is used",
"packageName": "@fluentui-react-native/win32-theme",
"email": "[email protected]",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion packages/experimental/Button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"@fluentui-react-native/use-styling": ">=0.7.1 <1.0.0",
"@fluentui-react-native/icon": "0.8.27",
"@fluentui-react-native/theme-tokens": ">=0.9.0 <1.0.0",
"@fluentui-react-native/styling-utils": ">=0.2.0 <1.0.0"
"@fluentui-react-native/styling-utils": ">=0.2.0 <1.0.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@fluentui-react-native/test-tools": ">=0.1.1 <1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/experimental/Button/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/experimental/Checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@fluentui-react-native/tokens": ">=0.10.1 <1.0.0",
"@fluentui-react-native/use-styling": ">=0.7.1 <1.0.0",
"@fluentui-react-native/adapters": ">=0.7.5 <1.0.0",
"@fluentui-react-native/pressable": ">=0.7.27 <1.0.0"
"@fluentui-react-native/pressable": ">=0.7.27 <1.0.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@office-iss/react-native-win32": "^0.63.7",
Expand Down
1 change: 1 addition & 0 deletions packages/experimental/Checkbox/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/experimental/Stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@uifabricshared/build-native": "^0.1.1",
"@uifabricshared/eslint-config-rules": "^0.1.1",
"react": "16.13.1",
"react-native": "^0.63.4"
"react-native": "^0.63.4",
"tslib": "^1.13.0"
},
"peerDependencies": {
"react": ">=16.13.1",
Expand Down
1 change: 1 addition & 0 deletions packages/experimental/Stack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/experimental/Tabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"@fluentui-react-native/tokens": ">=0.10.1 <1.0.0",
"@fluentui-react-native/use-styling": ">=0.7.1 <1.0.0",
"@fluentui-react-native/icon": "0.8.27",
"@fluentui-react-native/adapters": "0.7.5"
"@fluentui-react-native/adapters": "0.7.5",
"tslib": "^1.13.0"
},
"devDependencies": {
"@fluentui-react-native/test-tools": ">=0.1.1 <1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/experimental/Tabs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/experimental/Text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"dependencies": {
"@fluentui-react-native/adapters": ">=0.7.5 <1.0.0",
"@fluentui-react-native/framework": "0.6.3"
"@fluentui-react-native/framework": "0.6.3",
"tslib": "^1.13.0"
},
"devDependencies": {
"@fluentui-react-native/test-tools": ">=0.1.1 <1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/experimental/Text/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"@fluentui-react-native/use-slots": ">=0.5.8 <1.0.0",
"@fluentui-react-native/use-tokens": ">=0.1.6 <1.0.0",
"@fluentui-react-native/memo-cache": "^1.1.4",
"@fluentui-react-native/tokens": ">=0.10.1 <1.0.0"
"@fluentui-react-native/tokens": ">=0.10.1 <1.0.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/react": ">=16.9.34 < 16.14.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/framework/immutable-merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/jest": "^26.0.0",
"@types/node": "^10.3.5",
Expand Down
1 change: 1 addition & 0 deletions packages/framework/immutable-merge/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/memo-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@types/jest": "^26.0.0",
"@types/node": "^10.3.5",
"@uifabricshared/build-native": "^0.1.1",
"@uifabricshared/eslint-config-rules": "^0.1.1"
"@uifabricshared/eslint-config-rules": "^0.1.1",
"tslib": "^1.13.0"
}
}
1 change: 1 addition & 0 deletions packages/framework/memo-cache/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/merge-props/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"license": "MIT",
"dependencies": {
"@fluentui-react-native/immutable-merge": "^1.1.3",
"@fluentui-react-native/memo-cache": "^1.1.4"
"@fluentui-react-native/memo-cache": "^1.1.4",
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/jest": "^26.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/framework/merge-props/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/use-slot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"@fluentui-react-native/merge-props": ">=0.3.4 <1.0.0"
"@fluentui-react-native/merge-props": ">=0.3.4 <1.0.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@uifabricshared/build-native": "^0.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/framework/use-slot/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib",
"types": ["node", "jest"]
},
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/use-styling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"license": "MIT",
"dependencies": {
"@fluentui-react-native/memo-cache": "^1.1.4",
"@fluentui-react-native/use-tokens": "^0.1.6"
"@fluentui-react-native/use-tokens": "^0.1.6",
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/jest": "^26.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/framework/use-styling/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/use-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"license": "MIT",
"dependencies": {
"@fluentui-react-native/immutable-merge": "^1.1.3",
"@fluentui-react-native/memo-cache": "^1.1.4"
"@fluentui-react-native/memo-cache": "^1.1.4",
"tslib": "^1.13.0"
},
"devDependencies": {
"@fluentui-react-native/merge-props": "^0.3.4",
Expand Down
1 change: 1 addition & 0 deletions packages/framework/use-tokens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@uifabricshared/build-native/tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"outDir": "lib"
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion packages/theming/win32-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"@fluentui-react-native/theme-tokens": ">=0.9.0 <1.0.0",
"@fluentui-react-native/theme-types": ">=0.12.3 <1.0.0",
"@fluentui-react-native/theme": ">=0.5.21 <1.0.0",
"@fluentui-react-native/theming-utils": ">=0.7.6 <1.0.0"
"@fluentui-react-native/theming-utils": ">=0.7.6 <1.0.0",
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/react": ">=16.9.34 < 16.14.0",
Expand Down
Loading

0 comments on commit f657874

Please sign in to comment.