Skip to content

Commit b5cebd4

Browse files
committed
more migrations
1 parent 099345f commit b5cebd4

23 files changed

+406
-40
lines changed

packages/@rescript/runtime/Js_result.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25-
@deprecated("Please use `Belt.Result.t` instead")
25+
@deprecated({
26+
reason: "Use `result` directly instead",
27+
migrate: %replace.type(: result),
28+
})
2629
type t<+'good, +'bad> =
2730
| Ok('good)
2831
| Error('bad)

packages/@rescript/runtime/Stdlib_BigInt64Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2626
2727
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2828
*/
29-
@deprecated("Use `fromBuffer` instead") @new
29+
@deprecated({
30+
reason: "Use `fromBuffer` instead",
31+
migrate: BigInt64Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "BigInt64Array"
3138

3239
/** `fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
3340
3441
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3542
*/
36-
@deprecated("Use `fromBuffer` instead") @new
43+
@deprecated({
44+
reason: "Use `fromBuffer` instead",
45+
migrate: BigInt64Array.fromBuffer(
46+
%insert.unlabelledArgument(0),
47+
~byteOffset=%insert.labelledArgument("byteOffset"),
48+
~length=%insert.labelledArgument("length"),
49+
),
50+
})
51+
@new
3752
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3853
"BigInt64Array"
3954

@@ -51,7 +66,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t = "BigI
5166

5267
/** `fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: BigInt64Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t = "BigInt64Array.from"
5678

5779
/**

packages/@rescript/runtime/Stdlib_BigUint64Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2626
2727
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2828
*/
29-
@deprecated("Use `fromBuffer` instead") @new
29+
@deprecated({
30+
reason: "Use `fromBuffer` instead",
31+
migrate: BigUint64Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "BigUint64Array"
3138

3239
/** `fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
3340
3441
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3542
*/
36-
@deprecated("Use `fromBuffer` instead") @new
43+
@deprecated({
44+
reason: "Use `fromBuffer` instead",
45+
migrate: BigUint64Array.fromBuffer(
46+
%insert.unlabelledArgument(0),
47+
~byteOffset=%insert.labelledArgument("byteOffset"),
48+
~length=%insert.labelledArgument("length"),
49+
),
50+
})
51+
@new
3752
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3853
"BigUint64Array"
3954

@@ -51,7 +66,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t = "BigU
5166

5267
/** `fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: BigUint64Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t = "BigUint64Array.from"
5678

5779
/**

packages/@rescript/runtime/Stdlib_Float32Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2626
2727
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2828
*/
29-
@deprecated("Use `fromBuffer` instead") @new
29+
@deprecated({
30+
reason: "Use `fromBuffer` instead",
31+
migrate: Float32Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Float32Array"
3138

3239
/** `fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
3340
3441
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3542
*/
36-
@deprecated("Use `fromBuffer` instead") @new
43+
@deprecated({
44+
reason: "Use `fromBuffer` instead",
45+
migrate: Float32Array.fromBuffer(
46+
%insert.unlabelledArgument(0),
47+
~byteOffset=%insert.labelledArgument("byteOffset"),
48+
~length=%insert.labelledArgument("length"),
49+
),
50+
})
51+
@new
3752
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3853
"Float32Array"
3954

@@ -51,7 +66,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t = "Float
5166

5267
/** `fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: Float32Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t = "Float32Array.from"
5678

5779
/**

packages/@rescript/runtime/Stdlib_Float64Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2626
2727
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2828
*/
29-
@deprecated("Use `fromBuffer` instead") @new
29+
@deprecated({
30+
reason: "Use `fromBuffer` instead",
31+
migrate: Float64Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Float64Array"
3138

3239
/** `fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
3340
3441
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3542
*/
36-
@deprecated("Use `fromBuffer` instead") @new
43+
@deprecated({
44+
reason: "Use `fromBuffer` instead",
45+
migrate: Float64Array.fromBuffer(
46+
%insert.unlabelledArgument(0),
47+
~byteOffset=%insert.labelledArgument("byteOffset"),
48+
~length=%insert.labelledArgument("length"),
49+
),
50+
})
51+
@new
3752
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3853
"Float64Array"
3954

@@ -51,7 +66,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t = "Float
5166

5267
/** `fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: Float64Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t = "Float64Array.from"
5678

5779
/**

packages/@rescript/runtime/Stdlib_Int16Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2525
2626
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2727
*/
28-
@deprecated("Use `fromBuffer` instead") @new
28+
@deprecated({
29+
reason: "Use `fromBuffer` instead",
30+
migrate: Int16Array.fromBuffer(
31+
%insert.unlabelledArgument(0),
32+
~byteOffset=%insert.labelledArgument("byteOffset"),
33+
),
34+
})
35+
@new
2936
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int16Array"
3037

3138
/** `fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)
3239
3340
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3441
*/
35-
@deprecated("Use `fromBuffer` instead") @new
42+
@deprecated({
43+
reason: "Use `fromBuffer` instead",
44+
migrate: Int16Array.fromBuffer(
45+
%insert.unlabelledArgument(0),
46+
~byteOffset=%insert.labelledArgument("byteOffset"),
47+
~length=%insert.labelledArgument("length"),
48+
),
49+
})
50+
@new
3651
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3752
"Int16Array"
3853

@@ -50,7 +65,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t = "Int16Ar
5065

5166
/** `fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5267
*/
53-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
68+
@deprecated({
69+
reason: "Use `fromArrayLikeOrIterable` instead",
70+
migrate: Int16Array.fromArrayLikeOrIterable(
71+
%insert.unlabelledArgument(0),
72+
~map=%insert.unlabelledArgument(1),
73+
),
74+
})
75+
@val
5476
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t = "Int16Array.from"
5577

5678
/**

packages/@rescript/runtime/Stdlib_Int8Array.res

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2525
2626
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2727
*/
28-
@deprecated("Use `fromBuffer` instead") @new
28+
@deprecated({
29+
reason: "Use `fromBuffer` instead",
30+
migrate: Int8Array.fromBuffer(
31+
%insert.unlabelledArgument(0),
32+
~byteOffset=%insert.labelledArgument("byteOffset"),
33+
),
34+
})
35+
@new
2936
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int8Array"
3037

3138
/** `fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)
3239
3340
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3441
*/
35-
@deprecated("Use `fromBuffer` instead") @new
42+
@deprecated({
43+
reason: "Use `fromBuffer` instead",
44+
migrate: Int8Array.fromBuffer(
45+
%insert.unlabelledArgument(0),
46+
~byteOffset=%insert.labelledArgument("byteOffset"),
47+
~length=%insert.labelledArgument("length"),
48+
),
49+
})
50+
@new
3651
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3752
"Int8Array"
3853

@@ -50,7 +65,14 @@ external fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t = "Int8Arr
5065

5166
/** `fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5267
*/
53-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
68+
@deprecated({
69+
reason: "Use `fromArrayLikeOrIterable` instead",
70+
migrate: Int8Array.fromArrayLikeOrIterable(
71+
%insert.unlabelledArgument(0),
72+
~map=%insert.unlabelledArgument(1),
73+
),
74+
})
75+
@val
5476
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t = "Int8Array.from"
5577

5678
/**

0 commit comments

Comments
 (0)