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

Mock net and dns modules if running in browser #32

Closed
TimMikeladze opened this issue Jan 14, 2017 · 4 comments
Closed

Mock net and dns modules if running in browser #32

TimMikeladze opened this issue Jan 14, 2017 · 4 comments

Comments

@TimMikeladze
Copy link
Member

@davidyaha per our discussion in slack

The https://github.com/auth0/node-jsonwebtoken package has dependencies on the net and dns modules which aren't available on the client. This presents a problem since this is a repo publishing both client and server code in a single package.

Currently the work around is to mock them in the consuming app's webpack config as seen below.

node: {
    net: 'mock',
    dns: 'mock',
  },

The simple solution is to provide these mocks within the core accounts package if running on the browser.

@davidyaha
Copy link
Member

I've looked into it and we might want to setup lerna for the accounts package only. What do you think?

@TimMikeladze
Copy link
Member Author

TimMikeladze commented Jan 14, 2017

Fine by me. But I don't see how this will fix the problem unless the solution ends up being to split this repo up into a client and server repo? From my understanding lerna just helps in the management of a project with multiple packages.

@davidyaha
Copy link
Member

The repo will stay a mono repo but lerna will create at least two packages on npm. I think actually we need three packages: core, server and client.
Using lerna these packages will carry the same version number and we can do treeshaking for each of these separately.
We could actually manage the whole "suites" deal this way.. but this is for later time.

@TimMikeladze
Copy link
Member Author

This will be resolved by #33

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

No branches or pull requests

2 participants