Skip to content
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

Using Plotly with Salesforce (strict mode now enforced) #713

Closed
xmas opened this issue Jul 3, 2016 · 6 comments
Closed

Using Plotly with Salesforce (strict mode now enforced) #713

xmas opened this issue Jul 3, 2016 · 6 comments
Milestone

Comments

@xmas
Copy link

xmas commented Jul 3, 2016

Hello!

I'm super excited that Plotly is now open source, and I'm hoping to use it with an app I'm developing on the Salesforce platform.

Salesforce has recently put in place a new policy for 3rd party Javascript libraries: https://developer.salesforce.com/blogs/developer-relations/2016/04/introducing-lockerservice-lightning-components.html

Amongst other things, "strict" is on be default, and there are numerous areas where Plotly is failing.

I've just started looking through the errors and found a few things like:

<<<12586
var d3_document = this.document;
>>>
var d3_document = document;

<<< 13741
var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
>>>
var d3_mouse_bug44083 = navigator && /WebKit/.test(navigator.userAgent) ? -1 : 0;

I'm not sure if the roadmap for Plot.ly includes support for moving to ES6 (where strict is on be default), or if Plotly is using the D3.v4 (which I believe is ES6 compatible...).

If it's not, then I will look into seeing how many changes and where need to happen to get Plotly running again on Salesforce.

Thanks!

@etpinard etpinard added this to the v2.0.0 milestone Jul 4, 2016
@etpinard
Copy link
Contributor

etpinard commented Jul 4, 2016

Thanks for writing in.

All source files in this repo have strict mode enabled (as per the strict eslint rule).

I believe that most of our dependencies (e.g. the gl-vis packages) are strict mode compatible (thought I haven't checked).

So, this issue should be resolved by at the same time we bump d3 to v4 as part of our v2.0.0 release in late-2016. See more info here.

@xmas
Copy link
Author

xmas commented Jul 4, 2016

Thanks Etienne. I had sort of assumed there was a D3 versioning issue. Is there a v2.0.0 branch that is at any level of stability? I'd be happy to help test it when that effort gets underway.

@etpinard
Copy link
Contributor

etpinard commented Jul 4, 2016

Is there a v2.0.0 branch that is at any level of stability? I'd be happy to help test it when that effort gets underway.

Not at the moment, unfortunately. I'll comment on this thread once a v2.0.0 branch is up. That will probably have to wait for September 2016.

@etpinard
Copy link
Contributor

etpinard commented Jul 4, 2016

In the mean time, I'd recommend taking a looking at this gist that shows how to bundle plotly.js without d3.

Then, maybe someone out there made a patched version of d3@3.x that is strict mode compatible.

@xmas
Copy link
Author

xmas commented Jul 4, 2016

The specific Salesforce enforcement officially takes effect in October, so I might be able to stay on current versions. That is excellent advice though, so I will see if I can track it down.

@gvwilson
Copy link
Contributor

gvwilson commented Jun 5, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

@gvwilson gvwilson closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants