devexperts/remote-data-ts

'io-ts' and 'io-ts-types' are missing

Closed this issue · 8 comments

scink commented

because of remote-data-io.ts import in index.ts packages io-ts and io-ts-types became required. but they are in peerDependencies and NPM doesn't install them. that forces to install unnecessary for project packages manually. removing index.ts will fix it

main in package.json must be returned back to dist/remote-data.js. io-ts type must be imported from remote-data-ts/remote-data-io directly. This will be a breaking change. /cc @mlegenhausen

This is a regression after #19

We need to decide wether we want to keep all modules in the lib consistent.

  • If we remove direct reference from main module (index) to the module importing io-ts then we break consistency, end user will never know where exactly he'll receive "mising module" error.
  • If we remove main module (index) completely (which I'd prefer personally) we'll end up with inability to import directly from package from 'remote-data-ts'. Need to check how will this affect IDE autoimports etc.
  • On the other hand io-ts types is the functionaly of this lib as a whole so I'm not sure wether we should split it into separate incosistent modules. That's why io-ts and io-ts-types were added to peer-dependencies together with added index.ts - this is the main entry point which composes separate modules into the lib. Perhaps we could consider moving the libs from peer-dependencies to dependencies with a relaxed version (like '*').

/cc @mankdev

Removing the bug label because it's not as bug, new libs appear in npm warning about missing peer-dependencies.

I'll also update the commit tree with a BREAKING CHANGE: label and regenerate changelog later.

@raveclassic I like the third solution.

So after a brief discussion it was decided to move peer-dependencies to dependencies.
@scink Could you update #24 (and rename) accordingly?

scink commented

sure