-
Notifications
You must be signed in to change notification settings - Fork 715
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
Monolithic Browser Build #526
Comments
Ah amazing! Somehow I missed that. Thanks for pointing it out. It looks like a great starting point, but doesn't actually solve the issue I'd like to solve, namely the ability to load it in a Having a look at that "UMD" build, I see it's not actually UMD https://unpkg.com/@vx/vx@0.0.191/dist/vx-vx.umd.js That build appears to support AMD and CommonJS, but does not populate a browser global with the "meat" of the packages. It would be amazing if that build were tweaked such that:
I'm not sure where the build settings are defined in this project, but these are the desired outcomes. I would know how to set this up with Rollup. Need to investigate further, where the UMD build is configured. At first glance it seems that maybe the build is using Babel defaults? Not sure. I'd guess one of these is creating
|
It would be great to have a monolithic browser build of VX. If that existed, VX examples could run in browser-based coding/publishing environments like CodePen, Blockbuilder, and bl.ocks.org.
Currently, each package has its own browser build that appends properties to the
vx
global. While this partially solves the puzzle, one needs to include many<script>
tags to get it to work, and they need to be in topological order of the dependencies between them (if there are any). Also, these builds do not bundle smaller dependencies likeclassnames
.Ideally, users could pull in all the
VX
packages with a single<script>
tag.One subtle thing is that the browser build should ideally bundle the smaller dependencies like
classnames
andprop-types
, while excluding the larger ones likereact
andd3
(and instead pull them in from browser globals).As @pedroapfilho mentioned in a separate discussion:
This seems like a good approach to me! The monolith index could look something like that of D3: https://github.com/d3/d3/blob/master/index.js
Related to Code Sandbox(or something similar) for all examples in gallery. #432
The text was updated successfully, but these errors were encountered: