Closed phymous closed 6 years ago
Yes, this is intended. As you pointed out, the ES5 version can be found by requiring feathers-reactive/dist/feathers-reactive
.
When using the module directly the same module bundler configuration is necessary as when using Feathers directly on the client.
Is the import of feathers-reactive/dist/feathers-reactive
somewhere documented?
To be honest, this is the first client library I came across which does not provide the ES5 code per default :-)
Furthermore, isn't transpiling 3rd party code (e.g. by using a bundler like webpack) a bad practice? The Angular CLI, for instance, transpiles only self-written code. What if, for the sake of the example, feathers-reactive
would use some non-standard operator which is only supported by a specific babel
plugin? Would I have to install this plugin in my bundler setting?
Please correct me if I'm wrong, maybe I am missing something.
It works the same as using Feathers itself on the client. You can either configure your module bundler as documented or use the ES5 transpiled version (just like @feathersjs/client). Like Feathers, feathers-reactive
works in Node and on the client and is written with the features that the earliest supported version (6 LTS) of Node supports out of the box - so all standard ES6 (ES2015) features (the current version of JavaScript) without ES modules or anything else that is non-standard or would require other Babel plugins. You can find more about the reasons behind this in https://github.com/feathersjs/feathers/issues/608
A note in the readme for loading the transpiled version would be nice indeed though.
The
main
attribute of thefeathers-reactive
'spackage.json
points tolib/index
.lib/index
imports@feathersjs/commons/lib/utils
which itself contains the following ES6 code (snippet):This obviously causes a problem for IE11 due to the lacking ES6 support. When I import
feathers-reactive/dist/feathers-reactive
instead of justfeathers-reactive
, I get no error in IE 11.Is this intended?
System configuration
Module versions:
feathers-reactive
0.7.1Browser Version: IE 11
Module Loader: Webpack