Skip to content

Make parse compatible with CSP#87

Open
vrana wants to merge 2 commits intod3:mainfrom
vrana:csp
Open

Make parse compatible with CSP#87
vrana wants to merge 2 commits intod3:mainfrom
vrana:csp

Conversation

@vrana
Copy link
Copy Markdown

@vrana vrana commented Oct 14, 2021

Using parseRows with CSP enabled is quite cumbersome. I don't see a reason why this shouldn't just work (even though a little slower).

@koto
Copy link
Copy Markdown

koto commented Mar 2, 2022

Is there any reason not to merge it? This allows d3 to work on applications that use CSP without unsafe-eval, which seems quite beneficial. The less-performant branch is only taken if the new Function has failed due to CSP.

Copy link
Copy Markdown
Contributor

@curran curran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to make sure the new code is covered by tests.

@vrana
Copy link
Copy Markdown
Author

vrana commented Mar 14, 2022

I've added a test and fixed the formatting.

@curran
Copy link
Copy Markdown
Contributor

curran commented Nov 5, 2022

Just curious, how much slower is this?

@zzacharo
Copy link
Copy Markdown

Hey, any update on this? It would be really helpful for us as it would allow us to apply proper CSP while still using this library.

@hydrosquall
Copy link
Copy Markdown

Hey @vrana , would you be interested to reconcile this branch with the latest main?

I opened a very similar PR but it looks like you had this solution first, it would be great to revisit. The Function approach is great in environments that support it, but in environments that don't, a slower solution is better than a "page is blank" one.

#109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants