@@ -47,7 +47,7 @@ results.
4747
4848Duplicate modules of GraphQL.JS of the same version may also fail at runtime, sometimes in
4949unexpected 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
5151identify and distinguish between GraphQL schema elements, such as the particular GraphQL type.
5252Also, special exported constants like ` BREAK ` allow library users to manipulate visitor
5353behavior, also relying on the module identity.
@@ -56,8 +56,8 @@ To ensure that only a single GraphQL.JS module is used, all libraries depending
5656should use the appropriate peer dependency mechanism, as provided by their package manager,
5757bundler, 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
6262This additional validation is unnecessary in production, where the GraphQL.js library is
6363expected 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
102102In 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
113105Alternatively, 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
124116deno 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
130122export 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
138130bun --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
194186natively and requires no additional configuration. When using Webpack 4, development mode
195187must be enabled explicitly.
0 commit comments