@office-iss/react-native-win32 0.72.14 → 0.72.16

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/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 18 Mar 2024 20:19:17 GMT",
5
+ "date": "Thu, 11 Jul 2024 22:50:45 GMT",
6
+ "tag": "@office-iss/react-native-win32_v0.72.16",
7
+ "version": "0.72.16",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "jthysell@microsoft.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "eb2ae09b9f0b6f8e42096a1bac35d00423915052",
14
+ "comment": "Integrate to 0.72.15"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 27 May 2024 15:14:13 GMT",
21
+ "tag": "@office-iss/react-native-win32_v0.72.15",
22
+ "version": "0.72.15",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "email not defined",
27
+ "package": "@office-iss/react-native-win32",
28
+ "commit": "64e5b314ccba2fb500617b2617ffb9930cc945ab",
29
+ "comment": "integrate 0.72.14"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 18 Mar 2024 20:19:30 GMT",
6
36
  "tag": "@office-iss/react-native-win32_v0.72.14",
7
37
  "version": "0.72.14",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,33 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Mon, 18 Mar 2024 20:19:17 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 11 Jul 2024 22:50:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.72.14
7
+ ## 0.72.16
8
8
 
9
- Mon, 18 Mar 2024 20:19:17 GMT
9
+ Thu, 11 Jul 2024 22:50:45 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Missed property when adding win32 specific text type info (30809111+acoates-ms@users.noreply.github.com)
13
+ - Integrate to 0.72.15 (jthysell@microsoft.com)
14
14
 
15
+ ## 0.72.15
16
+
17
+ Mon, 27 May 2024 15:14:13 GMT
18
+
19
+ ### Patches
20
+
21
+ - integrate 0.72.14 (email not defined)
22
+
23
+ ## 0.72.14
24
+
25
+ Mon, 18 Mar 2024 20:19:30 GMT
26
+
27
+ ### Patches
28
+
29
+ - Missed property when adding win32 specific text type info (30809111+acoates-ms@users.noreply.github.com)
30
+
15
31
  ## 0.72.13
16
32
 
17
33
  Fri, 15 Mar 2024 22:28:10 GMT
@@ -562,10 +562,13 @@ function transformDataType(value: number | string): number | string {
562
562
  if (typeof value !== 'string') {
563
563
  return value;
564
564
  }
565
- if (/deg$/.test(value)) {
565
+
566
+ // Normalize degrees and radians to a number expressed in radians
567
+ if (value.endsWith('deg')) {
566
568
  const degrees = parseFloat(value) || 0;
567
- const radians = (degrees * Math.PI) / 180.0;
568
- return radians;
569
+ return (degrees * Math.PI) / 180.0;
570
+ } else if (value.endsWith('rad')) {
571
+ return parseFloat(value) || 0;
569
572
  } else {
570
573
  return value;
571
574
  }
@@ -564,10 +564,13 @@ function transformDataType(value: number | string): number | string {
564
564
  if (typeof value !== 'string') {
565
565
  return value;
566
566
  }
567
- if (/deg$/.test(value)) {
567
+
568
+ // Normalize degrees and radians to a number expressed in radians
569
+ if (value.endsWith('deg')) {
568
570
  const degrees = parseFloat(value) || 0;
569
- const radians = (degrees * Math.PI) / 180.0;
570
- return radians;
571
+ return (degrees * Math.PI) / 180.0;
572
+ } else if (value.endsWith('rad')) {
573
+ return parseFloat(value) || 0;
571
574
  } else {
572
575
  return value;
573
576
  }
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 72,
15
- patch: 6,
15
+ patch: 15,
16
16
  prerelease: null,
17
17
  };
@@ -30,6 +30,7 @@ export type LogData = $ReadOnly<{|
30
30
  message: Message,
31
31
  category: Category,
32
32
  componentStack: ComponentStack,
33
+ stack?: string,
33
34
  |}>;
34
35
 
35
36
  export type Observer = (
@@ -198,7 +199,7 @@ export function addLog(log: LogData): void {
198
199
  // otherwise spammy logs would pause rendering.
199
200
  setImmediate(() => {
200
201
  try {
201
- const stack = parseErrorStack(errorForStackTrace?.stack);
202
+ const stack = parseErrorStack(log.stack ?? errorForStackTrace?.stack);
202
203
 
203
204
  appendNewLog(
204
205
  new LogBoxLog({
@@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog';
14
14
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
15
15
  import UTFSequence from '../../UTFSequence';
16
16
  import stringifySafe from '../../Utilities/stringifySafe';
17
+ import ansiRegex from 'ansi-regex';
18
+
19
+ const ANSI_REGEX = ansiRegex().source;
17
20
 
18
21
  const BABEL_TRANSFORM_ERROR_FORMAT =
19
22
  /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/;
23
+
24
+ // https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184
25
+ const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp(
26
+ [
27
+ // Beginning of a line (per 'm' flag)
28
+ '^',
29
+ // Optional ANSI escapes for colors
30
+ `(?:${ANSI_REGEX})*`,
31
+ // Marker
32
+ '>',
33
+ // Optional ANSI escapes for colors
34
+ `(?:${ANSI_REGEX})*`,
35
+ // Left padding for line number
36
+ ' +',
37
+ // Line number
38
+ '[0-9]+',
39
+ // Gutter
40
+ ' \\|',
41
+ ].join(''),
42
+ 'm',
43
+ );
44
+
20
45
  const BABEL_CODE_FRAME_ERROR_FORMAT =
21
46
  // eslint-disable-next-line no-control-regex
22
47
  /^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u;
48
+
23
49
  const METRO_ERROR_FORMAT =
24
50
  /^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u;
25
51
 
@@ -166,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
166
192
  if (!s) {
167
193
  return null;
168
194
  }
169
- const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
195
+ const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
170
196
  if (!match) {
171
197
  return null;
172
198
  }
@@ -241,27 +267,31 @@ export function parseLogBoxException(
241
267
  };
242
268
  }
243
269
 
244
- const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
270
+ // Perform a cheap match first before trying to parse the full message, which
271
+ // can get expensive for arbitrary input.
272
+ if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) {
273
+ const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
245
274
 
246
- if (babelCodeFrameError) {
247
- // Codeframe errors are thrown from any use of buildCodeFrameError.
248
- const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
249
- return {
250
- level: 'syntax',
251
- stack: [],
252
- isComponentError: false,
253
- componentStack: [],
254
- codeFrame: {
255
- fileName,
256
- location: null, // We are not given the location.
257
- content: codeFrame,
258
- },
259
- message: {
260
- content,
261
- substitutions: [],
262
- },
263
- category: `${fileName}-${1}-${1}`,
264
- };
275
+ if (babelCodeFrameError) {
276
+ // Codeframe errors are thrown from any use of buildCodeFrameError.
277
+ const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
278
+ return {
279
+ level: 'syntax',
280
+ stack: [],
281
+ isComponentError: false,
282
+ componentStack: [],
283
+ codeFrame: {
284
+ fileName,
285
+ location: null, // We are not given the location.
286
+ content: codeFrame,
287
+ },
288
+ message: {
289
+ content,
290
+ substitutions: [],
291
+ },
292
+ category: `${fileName}-${1}-${1}`,
293
+ };
294
+ }
265
295
  }
266
296
 
267
297
  if (message.match(/^TransformError /)) {
@@ -10,6 +10,8 @@
10
10
 
11
11
  import typeof {enable} from 'promise/setimmediate/rejection-tracking';
12
12
 
13
+ import LogBox from './LogBox/LogBox';
14
+
13
15
  type ExtractOptionsType = <P>(((options?: ?P) => void)) => P;
14
16
 
15
17
  let rejectionTrackingOptions: $Call<ExtractOptionsType, enable> = {
@@ -34,19 +36,36 @@ let rejectionTrackingOptions: $Call<ExtractOptionsType, enable> = {
34
36
  ? rejection
35
37
  : JSON.stringify((rejection: $FlowFixMe));
36
38
  }
39
+ // It could although this object is not a standard error, it still has stack information to unwind
40
+ // $FlowFixMe ignore types just check if stack is there
41
+ if (rejection.stack && typeof rejection.stack === 'string') {
42
+ stack = rejection.stack;
43
+ }
37
44
  }
38
45
 
39
- const warning =
40
- `Possible Unhandled Promise Rejection (id: ${id}):\n` +
41
- `${message ?? ''}\n` +
42
- (stack == null ? '' : stack);
43
- console.warn(warning);
46
+ const warning = `Possible unhandled promise rejection (id: ${id}):\n${
47
+ message ?? ''
48
+ }`;
49
+ if (__DEV__) {
50
+ LogBox.addLog({
51
+ level: 'warn',
52
+ message: {
53
+ content: warning,
54
+ substitutions: [],
55
+ },
56
+ componentStack: [],
57
+ stack,
58
+ category: 'possible_unhandled_promise_rejection',
59
+ });
60
+ } else {
61
+ console.warn(warning);
62
+ }
44
63
  },
45
64
  onHandled: id => {
46
65
  const warning =
47
- `Promise Rejection Handled (id: ${id})\n` +
66
+ `Promise rejection handled (id: ${id})\n` +
48
67
  'This means you can ignore any previous messages of the form ' +
49
- `"Possible Unhandled Promise Rejection (id: ${id}):"`;
68
+ `"Possible unhandled promise rejection (id: ${id}):"`;
50
69
  console.warn(warning);
51
70
  },
52
71
  };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @flow strict
3
+ * @format
4
+ */
5
+
6
+ declare module 'ansi-regex' {
7
+ declare export type Options = {
8
+ /**
9
+ * Match only the first ANSI escape.
10
+ */
11
+ +onlyFirst?: boolean,
12
+ };
13
+ declare export default function ansiRegex(options?: Options): RegExp;
14
+ }
package/overrides.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "**/__snapshots__/**",
8
8
  "src/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.72.6",
10
+ "baseVersion": "0.72.15",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
@@ -35,7 +35,7 @@
35
35
  "type": "derived",
36
36
  "file": "src/Libraries/Animated/NativeAnimatedHelper.win32.js",
37
37
  "baseFile": "packages/react-native/Libraries/Animated/NativeAnimatedHelper.js",
38
- "baseHash": "e0365ebe34de05757962476b84fb581a3c007a19",
38
+ "baseHash": "ae83fb31990e1d572d743909f5bdd36589c86939",
39
39
  "issue": 11041
40
40
  },
41
41
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.72.14",
3
+ "version": "0.72.16",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,29 +26,30 @@
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "@jest/create-cache-key-function": "^29.2.1",
29
- "@react-native-community/cli": "11.3.7",
30
- "@react-native-community/cli-platform-android": "11.3.7",
31
- "@react-native-community/cli-platform-ios": "11.3.7",
29
+ "@react-native-community/cli": "^11.4.1",
30
+ "@react-native-community/cli-platform-android": "^11.4.1",
31
+ "@react-native-community/cli-platform-ios": "^11.4.1",
32
32
  "@react-native/assets": "1.0.0",
33
33
  "@react-native/assets-registry": "^0.72.0",
34
- "@react-native/codegen": "^0.72.7",
34
+ "@react-native/codegen": "^0.72.8",
35
35
  "@react-native/gradle-plugin": "^0.72.11",
36
36
  "@react-native/js-polyfills": "^0.72.1",
37
37
  "@react-native/normalize-colors": "^0.72.0",
38
38
  "@react-native/virtualized-lists": "^0.72.8",
39
39
  "abort-controller": "^3.0.0",
40
40
  "anser": "^1.4.9",
41
+ "ansi-regex": "^5.0.0",
41
42
  "art": "^0.10.0",
42
43
  "base64-js": "^1.1.2",
43
- "deprecated-react-native-prop-types": "4.1.0",
44
+ "deprecated-react-native-prop-types": "^4.2.3",
44
45
  "event-target-shim": "^5.0.1",
45
46
  "flow-enums-runtime": "^0.0.5",
46
47
  "invariant": "^2.2.4",
47
48
  "jest-environment-node": "^29.2.1",
48
49
  "jsc-android": "^250231.0.0",
49
50
  "memoize-one": "^5.0.0",
50
- "metro-runtime": "0.76.8",
51
- "metro-source-map": "0.76.8",
51
+ "metro-runtime": "^0.76.9",
52
+ "metro-source-map": "^0.76.9",
52
53
  "mkdirp": "^0.5.1",
53
54
  "nullthrows": "^1.1.1",
54
55
  "pretty-format": "^26.5.2",
@@ -83,7 +84,7 @@
83
84
  "just-scripts": "^1.3.3",
84
85
  "prettier": "^2.4.1",
85
86
  "react": "18.2.0",
86
- "react-native": "0.72.6",
87
+ "react-native": "0.72.15",
87
88
  "react-native-platform-override": "^1.9.4",
88
89
  "typescript": "^4.9.5"
89
90
  },