Skip to content

Commit 9be8a97

Browse files
committed
more migrations
1 parent e78f030 commit 9be8a97

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
@@ -27,14 +27,29 @@ external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?)
2727
2828
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2929
*/
30-
@deprecated("Use `fromBuffer` instead") @new
30+
@deprecated({
31+
reason: "Use `fromBuffer` instead",
32+
migrate: BigInt64Array.fromBuffer(
33+
%insert.unlabelledArgument(0),
34+
~byteOffset=%insert.labelledArgument("byteOffset"),
35+
),
36+
})
37+
@new
3138
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "BigInt64Array"
3239

3340
/** `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)
3441
3542
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3643
*/
37-
@deprecated("Use `fromBuffer` instead") @new
44+
@deprecated({
45+
reason: "Use `fromBuffer` instead",
46+
migrate: BigInt64Array.fromBuffer(
47+
%insert.unlabelledArgument(0),
48+
~byteOffset=%insert.labelledArgument("byteOffset"),
49+
~length=%insert.labelledArgument("length"),
50+
),
51+
})
52+
@new
3853
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3954
"BigInt64Array"
4055

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

5368
/** `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)
5469
*/
55-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
70+
@deprecated({
71+
reason: "Use `fromArrayLikeOrIterable` instead",
72+
migrate: BigInt64Array.fromArrayLikeOrIterable(
73+
%insert.unlabelledArgument(0),
74+
~map=%insert.unlabelledArgument(1),
75+
),
76+
})
77+
@val
5678
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t = "BigInt64Array.from"
5779

5880
/**

packages/@rescript/runtime/Stdlib_BigUint64Array.res

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

3340
/** `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)
3441
3542
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3643
*/
37-
@deprecated("Use `fromBuffer` instead") @new
44+
@deprecated({
45+
reason: "Use `fromBuffer` instead",
46+
migrate: BigUint64Array.fromBuffer(
47+
%insert.unlabelledArgument(0),
48+
~byteOffset=%insert.labelledArgument("byteOffset"),
49+
~length=%insert.labelledArgument("length"),
50+
),
51+
})
52+
@new
3853
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3954
"BigUint64Array"
4055

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

5368
/** `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)
5469
*/
55-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
70+
@deprecated({
71+
reason: "Use `fromArrayLikeOrIterable` instead",
72+
migrate: BigUint64Array.fromArrayLikeOrIterable(
73+
%insert.unlabelledArgument(0),
74+
~map=%insert.unlabelledArgument(1),
75+
),
76+
})
77+
@val
5678
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t = "BigUint64Array.from"
5779

5880
/**

packages/@rescript/runtime/Stdlib_Float32Array.res

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

3340
/** `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)
3441
3542
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3643
*/
37-
@deprecated("Use `fromBuffer` instead") @new
44+
@deprecated({
45+
reason: "Use `fromBuffer` instead",
46+
migrate: Float32Array.fromBuffer(
47+
%insert.unlabelledArgument(0),
48+
~byteOffset=%insert.labelledArgument("byteOffset"),
49+
~length=%insert.labelledArgument("length"),
50+
),
51+
})
52+
@new
3853
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3954
"Float32Array"
4055

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

5368
/** `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)
5469
*/
55-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
70+
@deprecated({
71+
reason: "Use `fromArrayLikeOrIterable` instead",
72+
migrate: Float32Array.fromArrayLikeOrIterable(
73+
%insert.unlabelledArgument(0),
74+
~map=%insert.unlabelledArgument(1),
75+
),
76+
})
77+
@val
5678
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t = "Float32Array.from"
5779

5880
/**

packages/@rescript/runtime/Stdlib_Float64Array.res

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

3340
/** `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)
3441
3542
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3643
*/
37-
@deprecated("Use `fromBuffer` instead") @new
44+
@deprecated({
45+
reason: "Use `fromBuffer` instead",
46+
migrate: Float64Array.fromBuffer(
47+
%insert.unlabelledArgument(0),
48+
~byteOffset=%insert.labelledArgument("byteOffset"),
49+
~length=%insert.labelledArgument("length"),
50+
),
51+
})
52+
@new
3853
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3954
"Float64Array"
4055

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

5368
/** `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)
5469
*/
55-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
70+
@deprecated({
71+
reason: "Use `fromArrayLikeOrIterable` instead",
72+
migrate: Float64Array.fromArrayLikeOrIterable(
73+
%insert.unlabelledArgument(0),
74+
~map=%insert.unlabelledArgument(1),
75+
),
76+
})
77+
@val
5678
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t = "Float64Array.from"
5779

5880
/**

packages/@rescript/runtime/Stdlib_Int16Array.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: Int16Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int16Array"
3138

3239
/** `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)
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: Int16Array.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
"Int16Array"
3954

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

5267
/** `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)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: Int16Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t = "Int16Array.from"
5678

5779
/**

packages/@rescript/runtime/Stdlib_Int8Array.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: Int8Array.fromBuffer(
32+
%insert.unlabelledArgument(0),
33+
~byteOffset=%insert.labelledArgument("byteOffset"),
34+
),
35+
})
36+
@new
3037
external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "Int8Array"
3138

3239
/** `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)
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: Int8Array.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
"Int8Array"
3954

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

5267
/** `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)
5368
*/
54-
@deprecated("Use `fromArrayLikeOrIterable` instead") @val
69+
@deprecated({
70+
reason: "Use `fromArrayLikeOrIterable` instead",
71+
migrate: Int8Array.fromArrayLikeOrIterable(
72+
%insert.unlabelledArgument(0),
73+
~map=%insert.unlabelledArgument(1),
74+
),
75+
})
76+
@val
5577
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t = "Int8Array.from"
5678

5779
/**

0 commit comments

Comments
 (0)