New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use es6 modules and webpack in prep for NPM publish #265
Conversation
Removed all wrapper functions from files
They are now individual modules and the factory imports them directly and registers them locally without suing contor-utils
Great! Adding
|
Also, in the spirit on modernizing jshintrc -> eslintrc ? |
|
||
|
||
export const axes = {}; | ||
export const addAxis = (name, axisCtor) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to export function addAxis
instead? afaik exporting a const arrow function will show up as anonymous in stacktraces, while exporting named functions will list it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes any difference for the stacktrace, I test all the options and the traces still get the correct function name... then found this
http://lukecod.es/2015/12/01/es6-arrow-function-stack-traces/
What're the before/after file-sizes of contour.min.js? |
Also exposes axis factories
…fic options. This was an issue on the order of merging of options with the visualization options
Also, for publishing to npm, you'll need to create an npm user for forio and make sure the |
Looks good!
|
I'll update the PR tonight. One more thing to note. I removed the /dist folder from the repo, this means that you will no longer be able to use Also, we need to remember to update |
I'd forgotten bower existed till I tried to build contour last week, so fine dropping it :) Tangentially, we've given up on making millions with Contour-advanced so contents of that repo should go somewhere public, just not sure where. Thoughts? Just new showcase examples? (I'll get you access to the advanced repo in a bit). |
Removed grunt and fix build-documentation
Moved to use Regarding advance viz, I think it would be good if they had their place in te showcase and then you could just install them like |
I'm having second thoughts about not including For new PRs it's useful to have devs include a jsfiddle in their example pointing to a jsfiddle demoing their change, for e.g. see #251 which has http://jsfiddle.net/3yqyvdud/4/ which points to a pre-built contour file for that PR, pulled from the incoming dist. This really reduces the friction of testing PRs, and puts the onus of making sure it builds/works on the submitter. Thoughts/ suggestions for a better workflow? |
Hey, I see the point of evaluating PRs from a jsfiddle, but I think you'd end up with unnecessary merge conflicts which is minor, but the bigger problem I think it is that you end up with a very confusing versioning, since the There is one posible solution, but it would mean to drop the bundle of the lodash merge/default functions. The solution is to include the I did a proof of concept jsfiddle here The changes required for this to work an on this commit I still don't think it would be a good solution, since it imposes an unnatural limit to what you can use, but I wanted to test what it would look like :) |
You can prevent merge conflicts / large diffs on dist if you mark minified files as "binary" in gitattributes (see https://github.com/forio/flow.js/blob/master/.gitattributes for e.g. https://blog.andrewray.me/dealing-with-compiled-files-in-git/ for more info). I don't think dist contour.js being of uncertain freshness is that big a deal, if you're explicitly copying source from github instead of cdn/npm you hopefully know what you're doing :) Source type module is an interesting idea, let me play around with that. |
A lot of changes. I tried to do the messy change of removing and re-indenting files on the first commit and then fixes on the following commits to make it a bit easier to see, but it is still hard to see the changes :(