Skip to content

feat: allow block.block_data similar to page.page_data#534

Merged
surajshetty3416 merged 2 commits intofrappe:developfrom
stravo1:allow-block-data
Mar 27, 2026
Merged

feat: allow block.block_data similar to page.page_data#534
surajshetty3416 merged 2 commits intofrappe:developfrom
stravo1:allow-block-data

Conversation

@stravo1
Copy link
Copy Markdown
Member

@stravo1 stravo1 commented Mar 26, 2026

Pass data from block data script to block client script directly using block.block_data keyword similar to how data.page_data works. In block client script that data is accessible via block_data.

Previously the only way to pass block data to the client side (client script JS) was through dynamic props - that too the data had to come from previous blocks. However it was a "hacky" and clumsy process. This highly simplifies the process of passing data between server (block data script) and client (block client script).

Before:

Screen.Recording.2026-03-26.at.11.52.31.PM.mp4

After:

Screen.Recording.2026-03-27.at.12.02.28.AM.mp4

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.52%. Comparing base (3d4e0e1) to head (b49bbcd).
⚠️ Report is 10 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #534   +/-   ##
========================================
  Coverage    63.52%   63.52%           
========================================
  Files           27       27           
  Lines         2794     2794           
========================================
  Hits          1775     1775           
  Misses        1019     1019           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@surajshetty3416
Copy link
Copy Markdown
Member

@stravo1 Linter is failing. Can you setup & run your pre-commit and push changes?

@stravo1 stravo1 requested a review from surajshetty3416 March 26, 2026 18:57
@surajshetty3416 surajshetty3416 merged commit f2ddf2e into frappe:develop Mar 27, 2026
9 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.23.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants