Skip to content

CSP nonce support for lazy functions #593

@pete-murphy

Description

@pete-murphy

See this comment.

We're trying to add nonces to elm-css-generated <style> tags, and are running into an issue that is not resolved by #570.

We're using elm-form's Form.renderStyledHtml, which calls Html.Styled.Lazy.lazy4, which calls VirtualDom.Styled.lazy4, which calls VirtualDom.Styled.toUnstyled.

We need to use toNonceUnstyled to pass the nonce of course, but there's no way to do this currently even if Form.renderStyledHtml took an optional nonce: it uses Html.Styled.Lazy which does not expose any way of passing the nonce through to the VirtualDom.Styled internals.

Unless I'm missing something, I think for CSP nonce support we would need to add Html.Styled.lazy* and VirtualDom.Styled.lazy* variants that take a nonce as argument (and call toNonceUnstyled internally).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions