GithubHelp home page GithubHelp logo

any-observable's Introduction

any-observable's People

Contributors

arcanis avatar jamestalmage avatar richienb avatar samverschueren avatar sindresorhus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

any-observable's Issues

[Bug] Please move rxjs dependency from dev to prod

Hi,

rxjs is required by any-observable during runtime. It is in devDependencies but should be in dependencies. Could you please make the change? This is causing issues when this library is installed by pnpm. We have a workaround to patch your package.json but ideally we would like to remove it.

Thank you in advanced,
-Rafael

rxjs before zen-observable?

It's got way more methods, lots more features. It seems to be the bluebird of observables (not sure on performance).

Register in browser

Parcel, babel, browserify and webpack seem to support optional require:

let Observable
try { Observable = require('zen-observable') } catch (e) {}

Is there any sense to enable register-shim to detect available observable libs as well?

ESM

Open to an ESM PR, for native ESM and/or Rollup?

Released version is missing files

I tried to use any-observable but received the error

Error: Cannot find module './register'

Dived into the code and it looks like the version that is being released on npm has the following files property specified.

  "files": [
    "index.js"
  ]

Is it possible to do a new released in between to fix that?

Doesn't seem to work with RxJS 6

Is it possible that the auto detect feature doesn't work for RxJS 6? Might have to pull in @benlesh here because I'm not sure what all the changes are in this new version.

So we try to load in rxjs/Observable right here. But it looks like that doesn't exist anymore and you need to import directly from rxjs instead.

So we can easily fix this by adding rxjs to the libs list as the last element in order to support RxJS 6. But before I do a PR, I need to be sure that my findings are correct.

Shortcut registrations?

I like that you can pick your desired registration. That's awesome. I never stopped to look at any-promise before. I dig it.

What about providing a list of shortcut registrations so you can do this:

ava --require=any-observable/register/zen
ava --require=any-observable/register/rxjs-minimal
ava --require=any-observable/register/rxjs-all

Keep them in a registration subfolder so they don't clutter up the main code base, and you can be pretty liberal about accepting PR's with registration shortcuts as new implementations become available.

Allow for different export patterns.

The string only option does not fit RxJs.

You can't do:

require('rxjs/Observable');

You need to do:

require('rxjs/Observable').Observable;

I think our default lookup strategy should be something like this:

function load(name) {
  var loaded = require(name);
  return loaded.Observable || loaded.default || loaded;
}

Just use rxjs-minimal instead of both rxjs-full and minimal

See this comment.

RxJs uses an interesting loader mechanism that allows users to specify exactly which Observable methods are implemented. This allows them to pursue a robust API, and users don't necessarily have to pay the price with larger browserified packages. (I think you can accomplish similar with bluebird, but it requires a build step - rxjs automates feature selection via require/import statements - it's pretty cool). More details here

Anyways. I think we should probably just select the minimal install when auto-resolving. Then users can patch to get the features they want, but we aren't necessarily loading the entirety of rxjs.

Documentation

We should write better documentation than just pointing to any-promise (though we can probably steal a good bit from there).

One important thing the any-promise documentation does is to offer a separate "Library Usage" section that discusses how Library authors should behave:

  • Don't call register yourself (leave that to the user).
  • Don't rely on non-standard features.
  • Document any-observable support prominently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.