Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#65734 [react] react@next is now react@cana…
Browse files Browse the repository at this point in the history
…ry by @eps1lon

* [react] react@next is now react@canary

* Same for react-dom

* Same for react-is
  • Loading branch information
Sebastian Silbermann authored Jun 19, 2023
1 parent 94d68a3 commit 291b21e
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions types/react-dom/next.d.ts → types/react-dom/canary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react-dom/next"` to the `"types"` array.
* is to add `"react-dom/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react-dom/next'
* import {} from 'react-dom/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react-dom/next" />
* /// <reference types="react-dom/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/

// See https://github.com/facebook/react/blob/main/packages/react-dom/index.js to see how the exports are declared,
// but confirm with published source code (e.g. https://unpkg.com/react-dom@next) that these exports end up in the published code
// but confirm with published source code (e.g. https://unpkg.com/react-dom@canary) that these exports end up in the published code

import React = require('react');
import ReactDOM = require('.');
Expand Down
2 changes: 1 addition & 1 deletion types/react-dom/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// but confirm with published source code (e.g. https://unpkg.com/react-dom@experimental) that these exports end up in the published code

import React = require('react');
import ReactDOM = require('./next');
import ReactDOM = require('./canary');

export {};

Expand Down
4 changes: 2 additions & 2 deletions types/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"default": "./client.d.ts"
}
},
"./next": {
"./canary": {
"types": {
"default": "./next.d.ts"
"default": "./canary.d.ts"
}
},
"./server": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="../next"/>
/// <reference types="../canary"/>

function preloadTest() {
function Component() {
Expand Down
2 changes: 1 addition & 1 deletion types/react-dom/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"index.d.ts",
"test/react-dom-tests.tsx",
"test/experimental-tests.tsx",
"test/next-tests.tsx"
"test/canary-tests.tsx"
],
"compilerOptions": {
"module": "commonjs",
Expand Down
6 changes: 3 additions & 3 deletions types/react-is/next.d.ts → types/react-is/canary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react-is/next"` to the `"types"` array.
* is to add `"react-is/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react-is/next'
* import {} from 'react-is/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react-is/next" />
* /// <reference types="react-is/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="../../react/experimental"/>
import * as React from 'react';
import * as ReactIs from 'react-is';
import 'react-is/next';
import 'react-is/canary';

// Suspense
ReactIs.isSuspenseList(<React.SuspenseList children={<div />} />); // true
Expand Down
2 changes: 1 addition & 1 deletion types/react-is/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"files": [
"index.d.ts",
"test/react-is-tests.tsx",
"test/next-tests.tsx"
"test/canary-tests.tsx"
]
}
2 changes: 1 addition & 1 deletion types/react/OTHER_FILES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next.d.ts
canary.d.ts
experimental.d.ts
jsx-dev-runtime.d.ts
jsx-runtime.d.ts
8 changes: 4 additions & 4 deletions types/react/next.d.ts → types/react/canary.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* These are types for things that are present in the React `next` release channel.
* These are types for things that are present in the React `canary` release channel.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react/next"` to the `"types"` array.
* is to add `"react/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react/next'
* import {} from 'react/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react/next" />
* /// <reference types="react/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
Expand Down
2 changes: 1 addition & 1 deletion types/react/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//
// Suspense-related handling can be found in ReactFiberThrow.js.

import React = require('./next');
import React = require('./canary');

export {};

Expand Down
6 changes: 3 additions & 3 deletions types/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"default": "./index.d.ts"
}
},
"./next": {
"./canary": {
"types@<=5.0": {
"default": "./ts5.0/next.d.ts"
"default": "./ts5.0/canary.d.ts"
},
"types": {
"default": "./next.d.ts"
"default": "./canary.d.ts"
}
},
"./experimental": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="../next"/>
/// <reference types="../canary"/>

const contextUsers = React.createContext(['HAL']);
const promisedUsers = Promise.resolve(['Dave']);
Expand Down
2 changes: 1 addition & 1 deletion types/react/ts5.0/OTHER_FILES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next.d.ts
canary.d.ts
experimental.d.ts
jsx-dev-runtime.d.ts
jsx-runtime.d.ts
8 changes: 4 additions & 4 deletions types/react/ts5.0/next.d.ts → types/react/ts5.0/canary.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* These are types for things that are present in the React `next` release channel.
* These are types for things that are present in the React `canary` release channel.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react/next"` to the `"types"` array.
* is to add `"react/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react/next'
* import {} from 'react/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react/next" />
* /// <reference types="react/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
Expand Down
2 changes: 1 addition & 1 deletion types/react/ts5.0/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//
// Suspense-related handling can be found in ReactFiberThrow.js.

import React = require('./next');
import React = require('./canary');

export {};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="../next"/>
/// <reference types="../canary"/>

const contextUsers = React.createContext(['HAL']);
const promisedUsers = Promise.resolve(['Dave']);
Expand Down
2 changes: 1 addition & 1 deletion types/react/ts5.0/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test/managedAttributes.tsx",
"test/hooks.tsx",
"test/experimental.tsx",
"test/next.tsx"
"test/canary.tsx"
],
"compilerOptions": {
"module": "commonjs",
Expand Down
2 changes: 1 addition & 1 deletion types/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test/managedAttributes.tsx",
"test/hooks.tsx",
"test/experimental.tsx",
"test/next.tsx"
"test/canary.tsx"
],
"compilerOptions": {
"module": "commonjs",
Expand Down

0 comments on commit 291b21e

Please sign in to comment.