-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Introducing partial dist bundles #740
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
Conversation
'use strict'; | ||
|
||
|
||
var Core = require('./core'); |
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.
Maybe worth an inline comment to note that Core
pulls in scatter. If I were looking to bundle my own, I'd start by copy/pasting this file, and I had to track down the inclusion of scatter.
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.
(To clarify, I had to stop and think whether core pulled it in or whether it was something pulled in indirectly by bar/pie.)
Was curious how much bar + pie takes up and what happens if assets are zipped. Created
|
@rreusser thanks for your investigations. I was thinking about outputting a Moreover, do you think we should add |
I like stats.md. Considered suggesting adding cli flag to the build task (or maybe adding a bundler command to Yeah, I'd think add |
@rreusser thanks for you input! I like the idea of adding a |
Shouldn't be too complicated—probably best to go in |
(But again, only if there's actually a reasonable use-case for this. Otherwise just more to maintain.) |
- which generated the dist/README.md on `npm run build` - bundle specific info such as the included (trace) module and size (including gzipped size) are generated on every build
|
||
|
||
// general info about distributed files | ||
var infoContent = [ |
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.
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.
As a fail-(slightly-)safe(r), can you include an html comment at the top of the markdown:
'<!--***********************************************************',
' This file is auto-generated by `npm run stats`.',
' Please do not edit this file directly.',
'***************************************************************-->',
I chose instead to output all
I chose otherwise. All partial bundles will be included on the npm
Although I'm not entirely convinced, I'd vote for making a separate |
|
||
'use strict'; | ||
|
||
var Plotly = require('./core'); |
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'd support a comment here noting that scatter is included in core. The first time I read through this, I was wondering if maybe bar or pie were cartesian and pulled in scatter through that (or some other magic). It's not that hard to figure out, but maybe just a nice sign-post if these are the template for creating your own. See: https://github.com/plotly/plotly.js/blob/master/src/plotly.js#L107-L108
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'd vote 👎 on adding a comment here (in all the other index files) to avoid making them obsolete when we'll strip more things for the ./core
.
I would prefer pointing users to the dist/README.md
file where coreModules
are listed:
Reviewed. No big surprises. Mixed feelings on bundling. At the end of the day, I feel like maybe just documenting the existing approach might be adequate. Otherwise we have to sort out all the relative path names, which might just not be worthwhile at this point. |
I guess I failed to care abound those details when I did read that part of the README, and failed to remember it when I cared. People showing up and wanting to bundle would probably start there, so I say LGTM. There's room to refine and refactor, but even pulling all of this into a standalone module would be a minor version bump (added featured, no existing functionality modified?), so I say 💃🏻 |
resolves #684
Here's the output: