Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

botframework-streaming should separate main/browser exports #1669

Closed
compulim opened this issue Feb 5, 2020 · 1 comment · Fixed by #1764
Closed

botframework-streaming should separate main/browser exports #1669

compulim opened this issue Feb 5, 2020 · 1 comment · Fixed by #1764

Comments

@compulim
Copy link
Contributor

compulim commented Feb 5, 2020

Versions

master as of right now.

Describe the bug

I briefed @stevengum and @ckkashyap offline on this one.

In https://github.com/microsoft/botbuilder-js/blob/master/libraries/botframework-streaming/src/index.ts, it is exporting namedPipe.js, which depends on Node.js net package.

Instead, we should have 2 entrypoints, one for Node.js and one for browser. For the browser one, it should not export namedPipe.js.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Webpack project
  2. Include botframework-streaming
  3. Run Webpack to bundle

Expected behavior

Webpack should not throw error.

Instead, Webpack is complaining it cannot bundle net package. This is because botframework-streaming/namedPipe.js depends on botframework-streaming.

Additional context

Also same for Node.js, which should not include dependencies that is targeting only browsers.

[bug]

@stevengum
Copy link
Member

webpack/webpack#4674

After syncing with @compulim in person, we're going use the package.json's "main" and "browser" field. We'll use either es5-index.js or browser-index.js for the "browser"/ES5-transpiled code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants