Skip to content

feat(artifacts): add RichArtifact for HTML/JS content#19726

Closed
aaazzam wants to merge 177 commits intomainfrom
feat/rich-artifact-type
Closed

feat(artifacts): add RichArtifact for HTML/JS content#19726
aaazzam wants to merge 177 commits intomainfrom
feat/rich-artifact-type

Conversation

@aaazzam
Copy link
Copy Markdown
Collaborator

@aaazzam aaazzam commented Dec 11, 2025

Adds a RichArtifact type that renders HTML/JS in a sandboxed iframe. Users can create interactive charts, visualizations, or custom HTML as artifacts.

Release Order

graphs#701
    ↓
prefect-ui-library#3109 (bump @prefecthq/graphs)
    ↓
prefect (this PR) — bump @prefecthq/prefect-ui-library after ui-library releases

Depends on: PrefectHQ/prefect-ui-library#3109 — merge and release ui-library first, then bump the dependency here.

Python SDK

  • RichArtifact class with html, sandbox, and csp fields
  • create_rich_artifact() / acreate_rich_artifact() helpers
  • Default sandbox: allow-scripts only (JS isolated from parent origin)

Usage

from prefect.artifacts import create_rich_artifact

create_rich_artifact(
    html="<html><body><script src='https://cdn.jsdelivr.net/npm/chart.js'></script>...</body></html>",
    key="my-chart",
)

🤖 Generated with Claude Code

aaazzam and others added 2 commits December 11, 2025 07:00
Add a new artifact type that renders HTML/JS in a sandboxed iframe.

- Add RichArtifact class with html, sandbox, and csp fields
- Add create_rich_artifact() and acreate_rich_artifact() helpers
- Default sandbox is allow-scripts only (JS runs but isolated from parent)
- Add tests for RichArtifact

Depends on: PrefectHQ/prefect-ui-library#3109

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #19726 will not alter performance

Comparing feat/rich-artifact-type (fc59c82) with main (3a423d0)

Summary

✅ 2 untouched

Comment thread src/prefect/artifacts.py
Comment thread src/prefect/artifacts.py Outdated
Comment thread src/prefect/artifacts.py
@aaazzam aaazzam requested a review from chrisguidry as a code owner December 14, 2025 03:42
aaazzam and others added 19 commits December 13, 2025 23:26
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…Service (#19756)

Co-authored-by: Claude <noreply@anthropic.com>
…g (OSS-7263) (#19786)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…19787)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…19785)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…9788)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…#19790)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…ptions (#19784)

Co-authored-by: Claude <noreply@anthropic.com>
…19792)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Nate Nowack <nate@prefect.io>
…ine chart (#19793)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
devin-ai-integration Bot and others added 13 commits December 24, 2025 11:09
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…19972)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…NG (#19980)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
…n wizard (#19983)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

devin-ai-integration Bot and others added 6 commits December 29, 2025 09:08
…yments tab (#19979)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex.s@prefect.io <ajstreed1@gmail.com>
Add a new artifact type that renders HTML/JS in a sandboxed iframe.

- Add RichArtifact class with html, sandbox, and csp fields
- Add create_rich_artifact() and acreate_rich_artifact() helpers
- Default sandbox is allow-scripts only (JS runs but isolated from parent)
- Add tests for RichArtifact

Depends on: PrefectHQ/prefect-ui-library#3109

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.