microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.52k stars 2.73k forks source link

[Feature]: add nonce to generated style elements (CSP) #25583

Closed miroslavstastny closed 1 year ago

miroslavstastny commented 2 years ago

Library

React Northstar / v0 (@fluentui/react-northstar)

Describe the feature that you would like added

Add support for adding nonce to style elements created by Fela renderer.

Fela supports nonce in version 11, but northstar uses version 10: https://github.com/robinweser/fela/pull/768. Fluent UI v9 supports nonce via Griffel: https://github.com/microsoft/griffel/issues/75.

I do not see any (effective) way how we could solve it through an enhancer as both createNode and getNodeFromCache are not renderer properties. We might patch Fela 10?

Have you discussed this feature with our team

No response

Additional context

No response

Validations

miroslavstastny commented 2 years ago

For v9, there is still FluentProvider style element which does not support nonce, see #25421.

miroslavstastny commented 1 year ago

Try bumping fela-dom in northstar, see how many screenshot regressions we get. Decide based on the result.