-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Don't export all of d3 #4379
Comments
ill work on this issue |
when i make the following changes obviously by removing the import command, the entire site goes blank. So what exactly do i need to do, could you please guide me |
I would expect that removing the
...should not make the whole site go blank - but it should make several of the tests fail. What kinds of errors do you see in the JavaScript console? |
i apologize, didnt remove export {d3} earlier. Its more or less working fine. |
I spent some time on this today and yesterday. This mostly works except for So for example, we have a test for the hover behavior. It simulates a mouse event. That mouse event ends up handled by So the copy of I can't think of a way to get these things working together. Maybe everywhere we import a It looks like d3.event is going away in the D3 v6 coming soonish, so it's not worth spending more time on this now since we'll have to change the code anyway. |
(re: #4379) This trims a bit more off the iD bundle size
(re: openstreetmap#4379) This trims a bit more off the iD bundle size
followup from #4372 (comment)
We're currently doing this in our iD
index.js
:So that later we can use it from our
spec_helper.js
so that tests can use it.Instead our test harness should be able to require d3 separately in
index.html
:... and that mostly works, except some of the tests that use events don't like it at all.
d3.event
is special because it's like a global event reference. The d3 docs have this to say:☝️ So I think this is an actual problem for how the tests are written, and we should figure out what this means and how to do the thing. I did a bit of debugging, but it involves digging into what the bundled d3 code is doing, because the sourcemaps lie.
The text was updated successfully, but these errors were encountered: