Giter VIP home page Giter VIP logo

Comments (12)

kirjs avatar kirjs commented on August 18, 2024

cc @aldendaniels @Kureev @joshhornby

from react-highcharts.

Kureev avatar Kureev commented on August 18, 2024

why not just react-highcharts/<name-of-module>?

from react-highcharts.

kirjs avatar kirjs commented on August 18, 2024
  1. So that it's explicit that those are modules
  2. So that we don't have a bunch of files in the roue.
  3. I was also thinking of generating them somehow, and this way files would be easier to clean and deal with if they are in a separate folder

from react-highcharts.

Kureev avatar Kureev commented on August 18, 2024

If I'm right, you can point index file in package.json in lib folder (or whatever) and in the same folder store all your module files, in this case relative path would be calculated relatively to index.

from react-highcharts.

Kureev avatar Kureev commented on August 18, 2024

Or, of course, you can create absolutely different packages and use them as plugins

from react-highcharts.

aldendaniels avatar aldendaniels commented on August 18, 2024

A similar (but modified) idea...

Idea

  1. Publish standalone NPM modules for the various Highcharts flavors we want to support with properly defined exports. Of course Highcharts really should be doing this for us... but they aren't. 😢

  2. Add an injectHighcharts() method to React Highcharts to get a handle to whatever copy of Highcharts the user is using.

  3. Stop bundling Highcharts.

  4. Then users can do this:

    import Highcharts from 'my-flavor-of-highcharts';
    import ReactHighcharts from 'react-highcharts';
    ReactHighcharts.injectHighcharts(Highcharts);
    
    // Then use <ReactHighcharts /> like normal.

Benefits

  1. We can separately version the Highchart modules and React Highcharts itself. This means that a breaking Highcharts change won't require a major version change for React Highcharts.
  2. We can separately version each Highcharts module. This is important if we want to support other Highcharts libraries such as Highmaps.
  3. Non-React developers can use the Highcharts NPM modules we'd be maintaining. This is good for everyone.
  4. The injector method avoids reliance on a global Highcharts variable. This reduces the risk of order-dependent module loading problems.

from react-highcharts.

aldendaniels avatar aldendaniels commented on August 18, 2024

@Kureev - Just saw your comment:

Or, of course, you can create absolutely different packages and use them as plugins

I think we're getting at the same idea.

from react-highcharts.

kirjs avatar kirjs commented on August 18, 2024

Default

var ReactHighcharts = require('react-highcharts') will expect a global Highcharts variable
Optionally it would be possible to inject a different version of highcharts
import Highcharts from 'my-flavor-of-highcharts'; import ReactHighcharts from 'react-highcharts'; ReactHighchartsWithFlavor = ReactHighcharts.injectHighcharts(Highcharts);
injectHighcharts in this case acts as a factory and creates a copy of reactHighcharts using different version of Highcharts, so it's possible to have several versions of react Highcharts if necessary.

Bundles

Looks like everybody agrees on bundles

Modules

Looks like most the ideal solution would be to have highcharts org to have each module as a separate npm package.
I actually see better modularization in their roadmap for highcharts 5.
http://www.highcharts.com/support/roadmap

This is coming on Q1 of 2016 though, and as a temporary solution we could follow @Kureev's suggestion and do something like this:

require('react-highcharts/more');
require('react-highcharts/exporting');
require('react-highcharts/heatmap');

from react-highcharts.

adamshone avatar adamshone commented on August 18, 2024

+1 for @Kureev's suggestion for modules. I'm trying (and failing) to get drilldown (http://www.highcharts.com/docs/chart-concepts/drilldown) working via react-highcharts at the moment, require('react-highcharts/drilldown'); sounds ideal.

from react-highcharts.

aldendaniels avatar aldendaniels commented on August 18, 2024

@kirjs - Looking good. I'd still suggest moving the Highcharts builds into separate NPM packages:

  • highcharts-build-more
  • highcharts-build-exporting
  • highcharts-build-heatmap

This is much more friendly to non-react consumers and makes for better semserver.

from react-highcharts.

kirjs avatar kirjs commented on August 18, 2024

@aldendaniels Will move out the modules once #44 is done

from react-highcharts.

kirjs avatar kirjs commented on August 18, 2024

Should be fixed starting with v3

from react-highcharts.

Related Issues (20)

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.