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';
2222import BrowserHosNameResolver from './browser-host-name-resolver' ;
2323import utf8Codec from './browser-utf8' ;
2424
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+
2536export const alloc = arg => new HeapBuffer ( arg ) ;
2637export const Channel = WebSocketChannel ;
2738export const HostNameResolver = BrowserHosNameResolver ;
Original file line number Diff line number Diff line change @@ -22,6 +22,17 @@ import NodeChannel from './node-channel';
2222import NodeHostNameResolver from './node-host-name-resolver' ;
2323import utf8Codec from './node-utf8' ;
2424
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+
2536export const alloc = arg => new NodeBuffer ( arg ) ;
2637export const Channel = NodeChannel ;
2738export const HostNameResolver = NodeHostNameResolver ;
You can’t perform that action at this time.
0 commit comments