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

Split into multiple modules #53

Closed
neocotic opened this issue Aug 5, 2016 · 5 comments
Closed

Split into multiple modules #53

neocotic opened this issue Aug 5, 2016 · 5 comments

Comments

@neocotic
Copy link
Owner

neocotic commented Aug 5, 2016

In order to make QRious easier for developers to install and to simplify the node-canvas dependency which is only required when running on Node.js.

I'm currently planning on splitting the code base into the following modules:

  • qrious-core
    • The logic shared by both qrious-node and qrious
    • Should not contain any environment-specific code (e.g. browser, Node.js)
  • qrious-node
    • The Node.js version of QRious
  • qrious
    • The browser version of QRious

The modules would be contained within the same Git repository to simplify development of cross-module dependencies as well as releases.

Ideally, developers should be able to build all modules from the repository root as well as build individual modules from within their directory. Shared configurations and documentation should be contained within the repository root to avoid too much duplication.

@neocotic neocotic added this to the 3.0.0 milestone Aug 5, 2016
@neocotic
Copy link
Owner Author

neocotic commented Aug 5, 2016

This should hopefully help address #51 since projects using Browserify/Webpack can continue to depend on qrious which will be browser-only. Projects wanting to run QRious on Node.js would depend on qrious-node and only then will the node-canvas dependency be required.

@leeyeh
Copy link

leeyeh commented Aug 6, 2016

Actually, the browser field is introduced to solve such problems: https://github.com/defunctzombie/package-browser-field-spec. Most modern bundlers respect this field.

IMHO, one universal package is easier to consume and maintain.

@neocotic
Copy link
Owner Author

neocotic commented Aug 6, 2016

@leeyeh, you seem to know about this better than me, so could you please take a quick look at the current system and tell me how I could improve it QRious is using the browser field but #51 states that our dependencies are still causing problems.

I do like the idea of keeping it a single module for simplicity but if the node-canvas dependency is still causing problems, I'd rather put a nail in it by splitting it up. I don't think the bundlers document how to manage dependencies for specific environments well enough. I'd rather only Node.js users had to be even aware that node-canvas was required.

@leeyeh
Copy link

leeyeh commented Aug 6, 2016

Sorry I should have checked the code first.

The package.json is well configured now. The package can be consumed by webpack properly. I will create a sample for #51 .

@neocotic
Copy link
Owner Author

neocotic commented Jun 1, 2017

I'm going for this as the current setup is too much of a headache both to maintain and to use. We'll have the following modules in the end:

  • qrious will provide the browser implementation only
  • qrious-core will contain the guts and support all environments via adapters
  • node-qrious will provide the Node.js implementation only

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