svg-to-geojson
svg-to-geojson copied to clipboard
Support easier individual imports of modules
Currently
Everywhere, including documentation and examples, we ask developers to import modules from the package directly, like this:
import { Region } from 'frint-react';
// this import also brings `render` and `streamProps` for example
Some applications may need only one specific module from a given package, but they will still end up loading all the modules from that package in the runtime.
We can possibly get around this by tree-shaking during the bundling process, but the application on the server will not benefit from it in any way.
Area for improvement
Without breaking the API, allow developers to import only the modules they want individually, like this:
import Region from 'frint-react/Region';
To do this, we need to add files in the root directory of the packages according to the exported module names listed in their main index.js
file.
better do named exports:
import { Region } from 'frint-react/Region';
instead of:
import Region from 'frint-react/Region';