likr / egraph

Layered graph layout tools
MIT License
15 stars 5 forks source link

support for all browsers, ES6 generator , Weakmap #1

Closed jscsharp closed 7 years ago

jscsharp commented 7 years ago

Hi Is it possible to compile the code to ES5? to able to run on all browsers.

Thanks

likr commented 7 years ago

Thanks, but I don't provide compiled code from this repository. Please use babel in your application.

For example, webpack setting with babel-loader is as follows:

module.exports = {
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        include: [
          path.resolve(__dirname, 'src'),
          path.resolve(__dirname, 'node_modules/egraph')
        ],
        loader: 'babel-loader',
        query: {
          presets: ['latest'],
          plugins: ['transform-react-jsx']
        }
      }
    ]
  },
  // ...
}
jscsharp commented 7 years ago

Thanks, for your reply. I will test it.

jscsharp commented 7 years ago

I made es5 compilation using webpack, babel. But for WeakMap usage in the code, IE11 does not support it, as mention here: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/WeakMap

Is this good option to use following code to polyfill WeakMap in IE11 or older browsers which does not support WeakMap? https://github.com/Benvie/WeakMap

Thanks

likr commented 7 years ago

You can use babel-polyfill. see: https://babeljs.io/docs/usage/polyfill/

jscsharp commented 7 years ago

Thanks a lot.