Skip to content

Commit cfdce89

Browse files
committed
update docs
1 parent d245e12 commit cfdce89

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

website/pages/docs/development-mode.mdx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ results.
4747

4848
Duplicate modules of GraphQL.JS of the same version may also fail at runtime, sometimes in
4949
unexpected ways. This is because GraphQL.JS relies on the identity of the module for
50-
key features. Most significantly, `instanceof` checks are used throughout GraphQL.JS to
50+
key features. Most significantly, unique symbols are used throughout GraphQL.JS to
5151
identify and distinguish between GraphQL schema elements, such as the particular GraphQL type.
5252
Also, special exported constants like `BREAK` allow library users to manipulate visitor
5353
behavior, also relying on the module identity.
@@ -56,8 +56,8 @@ To ensure that only a single GraphQL.JS module is used, all libraries depending
5656
should use the appropriate peer dependency mechanism, as provided by their package manager,
5757
bundler, build tool, or runtime.
5858

59-
In development mode, GraphQL.JS provides a validation check triggered by any use of `instanceof`
60-
that should catch most cases of multiple GraphQL.js modules being used in the same project.
59+
In development mode, GraphQL.JS provides validation checks that should catch most cases of
60+
multiple GraphQL.js modules being used within the same project.
6161

6262
This additional validation is unnecessary in production, where the GraphQL.js library is
6363
expected to be have been setup correctly as a single module. So as to avoid the performance
@@ -100,39 +100,31 @@ to enable development mode without the need for an explicit import.
100100
### Node.js
101101

102102
In Node.js, the development condition can be enabled by passing the `--conditions=development`
103-
flag to the Node.js runtime. This can be done within `package.json` scripts:
104-
105-
```json
106-
{
107-
"scripts": {
108-
"start": "node --conditions=development index.js"
109-
}
110-
}
111-
```
103+
flag to the Node.js runtime.
112104

113105
Alternatively, this can be included within the `NODE_OPTIONS` environment variable:
114106

115107
```bash
116-
export NODE_OPTIONS=development
108+
export NODE_OPTIONS=--conditions=development
117109
```
118110

119111
#### Deno
120112

121-
In Deno, conditional exports are not yet released, but are available within the latest canary build as follows:
113+
In Deno version 2.4.0 and later, you can enable the development condition by passing the `--conditions=development` flag to the runtime:
122114

123115
```bash
124116
deno run --conditions=development main.js
125117
```
126118

127-
Alternatively, within the canary build, this can be included within the `DENO_CONDITIONS` environment variable:
119+
Alternatively, the `DENO_CONDITIONS` environment variable may be used:
128120

129121
```bash
130122
export DENO_CONDITIONS=development
131123
```
132124

133125
#### Bun
134126

135-
In Bun, you can also enable the development condition by passing the `--conditions=development` to the runtime:
127+
In Bun version 1.0.30 and later, you can enable the development condition by passing the `--conditions=development` flag to the runtime:
136128

137129
```bash
138130
bun --conditions=development main.js
@@ -190,6 +182,6 @@ must be enabled explicitly.
190182

191183
### create-react-app
192184

193-
When using Webpack 5 as its bundler, create-react-app support the 'development' condition
185+
When using Webpack 5 as its bundler, create-react-app supports the 'development' condition
194186
natively and requires no additional configuration. When using Webpack 4, development mode
195187
must be enabled explicitly.

0 commit comments

Comments
 (0)