File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,17 @@ import WebSocketChannel from './browser-channel';
22
22
import BrowserHosNameResolver from './browser-host-name-resolver' ;
23
23
import utf8Codec from './browser-utf8' ;
24
24
25
+ /*
26
+
27
+ This module exports a set of components to be used in browser environment.
28
+ They are not compatible with NodeJS environment.
29
+ All files import/require APIs from `node/index.js` by default.
30
+ Such imports are replaced at build time with `browser/index.js` when building a browser bundle.
31
+
32
+ NOTE: exports in this module should have exactly the same names/structure as exports in `node/index.js`.
33
+
34
+ */
35
+
25
36
export const alloc = arg => new HeapBuffer ( arg ) ;
26
37
export const Channel = WebSocketChannel ;
27
38
export const HostNameResolver = BrowserHosNameResolver ;
Original file line number Diff line number Diff line change @@ -22,6 +22,17 @@ import NodeChannel from './node-channel';
22
22
import NodeHostNameResolver from './node-host-name-resolver' ;
23
23
import utf8Codec from './node-utf8' ;
24
24
25
+ /*
26
+
27
+ This module exports a set of components to be used in NodeJS environment.
28
+ They are not compatible with browser environment.
29
+ All files that require environment-dependent APIs should import this file by default.
30
+ Imports/requires are replaced at build time with `browser/index.js` when building a browser bundle.
31
+
32
+ NOTE: exports in this module should have exactly the same names/structure as exports in `browser/index.js`.
33
+
34
+ */
35
+
25
36
export const alloc = arg => new NodeBuffer ( arg ) ;
26
37
export const Channel = NodeChannel ;
27
38
export const HostNameResolver = NodeHostNameResolver ;
You can’t perform that action at this time.
0 commit comments