fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Impossible to use react-northstar with strict Content Security Policies

Open AlexisGlez opened this issue 5 years ago • 2 comments

Describe the feature that you would like added

I am working on an application for React Teams and I started using @fluentui/react-northstar as my main component library for the app. Currently, the app that I'm working with has a lot of really strict Content Security Policies (CSP) in place, which are blocking the styles generated by react-northstar to be injected into my app.

After doing some research, I noticed that react-northstar is using fela to generate styles dynamically. The fela package had this exact same issue before, but they fixed it in the latest version of the package (version > 11).

After playing with @fluentui/react-northstar and @fluentui/react-northstar-fela-renderer I verified that if @fluentui/react-northstar-fela-renderer updates the fela version to the latest one, developers would be able to specify a nonce for the generated styles, which will allow react-northstar to be compliant with strict Content Security Policies.

What component or utility would this be added to

@fluentui/react-northstar-fela-renderer

Have you discussed this feature with our team, and if so, who

Noup.

AlexisGlez avatar Apr 23 '21 19:04 AlexisGlez

Also, after @fluentui/react-northstar-fela-renderer updates the fela package to the latest version, @fluentui/react-northstar will need to use the latest version of @fluentui/react-northstar-fela-renderer and bump a new release :)

AlexisGlez avatar Apr 23 '21 19:04 AlexisGlez

@AlexisGlez we support nonce configuration for Emotion renderer from 0.55.x, https://github.com/microsoft/fluentui/pull/17972. This should unblock you 😃

We are not going to bump Fela 11 soon as we are going to switch to Emotion as a default renderer.

layershifter avatar May 25 '21 10:05 layershifter