Uniforms: Dependencies on simpl-schema and graphql

Created on 18 Apr 2017  ·  9Comments  ·  Source: vazco/uniforms

I’m going to use JSONSchema but forced to install graphql and simpl-schema because of these dependencies.

├── UNMET PEER DEPENDENCY graphql@^0.8.2 || ^0.9.1
├── UNMET PEER DEPENDENCY simpl-schema@^0.2.0 || ^0.1.0 || ^0.0.4

Is it hard to extract bridges into separate modules?

question

Most helpful comment

made it work by adding that into webpack.config.js:

      alias: {
        graphql: 'empty-module',
        'simpl-schema': 'empty-module',
        'meteor/check': 'empty-module',
        'meteor/aldeed:simple-schema': 'empty-module',
      },

Thanks for the advice!

All 9 comments

Hey, @oluckyman. At first, you are not forced to install them - these are peer dependencies, not _(hard)_ dependencies. It's not hard to separate them - it's already on roadmap - but it's a breaking change, which will be part of 2.0. When? Well... In the future.

Right, the app is working. But these warnings also in devtools console which is not good for development process at all.
Just installed peer deps, but still having these warnings:

Warning in ./~/uniforms/SimpleSchemaBridge.js
Module not found: 'meteor/check' in .../node_modules/uniforms

 @ ./~/uniforms/SimpleSchemaBridge.js 79:16-33

Warning in ./~/uniforms/SimpleSchemaBridge.js
Module not found: 'meteor/aldeed:simple-schema' in .../node_modules/uniforms

 @ ./~/uniforms/SimpleSchemaBridge.js 83:23-55

I‘m not using meteor. Should I install these too?

You can't install them - these are Atmosphere _(Meteors package ecosystem)_ packages. I'll try to figure out some kind of lazy loading it, but there's not much non-breaking stuff I can do.

got it thanks

I’ll try to make a fork and remove dependencies on bridges. It should resolve all warnings because all of them are going from bridges.
Could you please suggest how to do it?

You want a workaround, huh? I see you are using webpack. You can create an alias for each of these packages and export an undefined from there - it will dismiss this warning and behave correctly.

should it be something like this?

alias: {
 'handlebars': 'noopModule.js',
 'meteor/check': 'noopModule.js',
 'meteor/aldeed:simple-schema': 'noopModule.js',
}
// noopModule.js
export default undefined;

If it works, then yes - I don't have a project on webpack configured, so I'm not sure.

made it work by adding that into webpack.config.js:

      alias: {
        graphql: 'empty-module',
        'simpl-schema': 'empty-module',
        'meteor/check': 'empty-module',
        'meteor/aldeed:simple-schema': 'empty-module',
      },

Thanks for the advice!

Was this page helpful?
0 / 5 - 0 ratings