惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
T
Threatpost
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
D
Docker
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
T
Troy Hunt's Blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
F
Full Disclosure
B
Blog
O
OpenAI News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
Know Your Adversary
Know Your Adversary
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Recorded Future
Recorded Future
IT之家
IT之家
Project Zero
Project Zero
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Sanity.io

A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity Build a prototype with Claude Code that your whole team can edit | Sanity What’s New - May 2026 | Sanity I built a London pub guide with v0 and the Sanity MCP in six hours. Here's what I learned. | Sanity Build a conference concierge with Agent Context and Anthropic | Sanity Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK | Sanity How I used Agent API to generate photos for my family’s recipes | Sanity What’s New April - 2026 | Sanity Better context, better matches: An AI love story (for dogs) | Sanity How to write for an agent | Sanity Content Agent, meet Slack: AI content operations in your workflow | Sanity Structure powers intelligence | Sanity Your agent needs better content. Here's how to give it. | Sanity How to serve content to agents (a field guide) | Sanity Sanity TypeGen GA: Automatic TypeScript types for content and GROQ | Sanity Sanity is now available on the Vercel Marketplace | Sanity The logo soup problem (and how to solve it) | Sanity Content Releases: From scattered updates to coordinated publishing | Sanity What's New - February 2026 | Sanity How we solved the agent memory problem | Sanity v0 Builder Challenge: The winners | Sanity Introducing: Sanity Agent Skills | Sanity Content Agent: Days of work in one conversation | Sanity Our Sanity Values | Sanity Open Source Pledge 2025: Stepping up when it matters | Sanity v0 builder challenge: $3000 in prizes | Sanity Why AI Breaks Without Structured Content Operations | Sanity What’s New January - 2026 | Sanity BFCM 2025: What teams built when infrastructure stopped being the problem | Sanity How AI shaped holiday shopping and what it means for content in 2026 | Sanity Sanity Studio v5: Embracing React 19 | Sanity You’ll need a CMS eventually. Let your agent set it up. | Sanity “You should never build a CMS” | Sanity AI Content Operations: A 30-Day Implementation Guide | Sanity What’s New December - 2025 | Sanity Scheduled Drafts: Stop manually publishing content at midnight | Sanity What’s New November - 2025 | Sanity Everything *[NYC] 2025 recap: A day of AI, Content Operations, and Culture | Sanity Clankers and content operations | Sanity Content Agent: AI that understands your structured content is here | Sanity Why design-driven content modeling creates technical debt, not velocity | Sanity What's New October - 2025 | Sanity From studio to inbox: How Kevin Green eliminated email campaign friction | Sanity The content editor's guide to content operations [E-commerce edition] | Sanity styled-components maintenance mode: A 40% faster fork | Sanity From zero code to a live website in 7 hours (thanks, Cursor!) | Sanity First attempt will be 95% garbage: A staff engineer's 6-week journey with Claude Code | Sanity Internationalization is more than translating words | Sanity What's New - September 2025 | Sanity We just deleted our 35k-member community Slack | Sanity What's New - August 2025 | Sanity The engineer's guide to content operations [E-commerce edition] | Sanity SEO for AI: Evolving from Web Pages to the Content Lake | Sanity What's New - July 2025 | Sanity Sanity Studio v4: A major version bump for a minor reason | Sanity What's New - June 2025 | Sanity Dashboard and Insights: Your New Content HQ | Sanity Canvas: AI-accelerated, context-aware, freeform authoring | Sanity Agent Actions: AI building blocks for structured content | Sanity Functions: Life beyond pressing publish | Sanity A new era for content applications with Sanity App SDK | Sanity The end of CMS era and our $85M Series C. | Sanity What's New – May 2025 | Sanity Introducing the Sanity Model Context Protocol (MCP) server | Sanity What's New – April 2025 | Sanity Pushing all the envelopes with ambitious content | Sanity Self-hosting is only free if your time is worth nothing | Sanity Content that lasts: Scaling beyond your frontend | Sanity The Live Content API is now Generally Available | Sanity The future beyond AI chat bots | Sanity Learning the new skill of working with AI | Sanity What's New - March 2025 | Sanity Give it in plain text: Making your content AI-Ready | Sanity No More 'DO NOT PUBLISH': Introducing Content Releases | Sanity React in 2025, what's next? | Sanity Introducing Sanity for Startups | Sanity A block content editor that loves you back | Sanity A Black Friday Snooze Fest: Massive Traffic, No Drama | Sanity How to make a recipe site that scales well | Sanity The Sanity Winter Release 2024 | Sanity AVIF Arrives, Sanity’s Promise Fulfilled | Sanity Sanity joins the Open Source Pledge | Sanity Your content is now Live by default | Sanity Begin Team to Join Sanity | Sanity Sanity Digest - September '24 Edition | Sanity Sanity partners with Google. Now live on the Google Cloud Marketplace. | Sanity Sanity Digest - August ‘24 Edition | Sanity Now playing: the latest Mux Video Input plugin for Sanity | Sanity Community Digest - June ‘24 Edition | Sanity Community Digest - May ‘24 Edition | Sanity Guide to Sanity's newest product announcements | Sanity AI and Content Creation: A Leader's Guide | Sanity Of course, you should be able to type your content quickly! | Sanity New to AI Assist: translation, reference suggestions, image generation | Sanity Speak the language of your editors: Sanity Studio UI localization | Sanity Introducing the new Sanity Growth plan to serve collaborative teams | Sanity Presentation: Work faster than ever with structured content | Sanity Goodbye Feedback Frenzy, Hello Sanity Studio Comments! | Sanity Easing into the App Router with the Sanity Toolkit for Next.js | Sanity Making website updates easier with structured content | Sanity
The final boss of front-end: block editors | Sanity
Simeon Griggs · 2025-02-07 · via Sanity.io

Code && Content Podcast

This is a recap of one episode of the Code && Content podcast, head to the show page to find out more and subscribe on YouTube or the podcast player of your choice.

Subscribe

Text editors are typically known as the final boss of front-end. There is so much built-in expectation from decades of experience of editors creating content. And content creation has only gotten more complex as we've moved from rich text editors in the past (TinyMCE, CKEditor etc) to the block content editors (Notion, Confluence, etc) of the present. Each of them work differently in small ways, and yet everybody brings the expectation that they must work.

The problem with simple rich text editors is that they store content as a string, like HTML or Markdown. Which is difficult to serialize and easy to break.

While many block editor applications typically lock down and store content in a proprietary format or cannot be embedded in your application.

If you've ever tried implementing a block editor into your applications, you're probably aware of the challenges of just trying to integrate something that is pre-built, let alone building your own block editor from scratch.

Christian Grøngaard, today's guest on the podcast has spent the last few months taking the Portable Text Editor—a customized version of the Slate.js block editor hard-coded into Sanity Studio—and extracting it into a reusable component. Now available as a standalone package to insert into any React application, distributed as the Portable Text Editor.

I've struggled in the past to implement existing block editors, but the Portable Text Editor the first block editing package which I have felt has a truly intuitive API.

It has a React-friendly declarative design to rendering text and components, setting and declaring schema types, as well as being able to set custom behaviours for events that happen. Events as simple as inserting text or complex as building your own "slash command," or opening a modal based on a character being typed.

I've built two demo apps already with different frontend libraries. One with the Tailwind CSS Headless UI library and another with shadcn/ui. In both cases, I'm able to have full control over how the editor looks while still relying on the Portable Text Editor package to handle all of the behaviors of content being generated.

It's only once you start implementing a block editor yourself you may begin to realize how many built-in expectations you have, which you've never thought twice about. Where should the toolbar be located? What should happen if I try to toggle bold using the spacebar? These are all concerns that need to be built into a block editor and need to have an accompanying test suite. That's what Christian has had to do to make sure that the Portable Text Editor is as reliable as possible.

There is also a whole world of block editor terminology and syntax that you may never have heard before. Maybe you know what your "caret" is, but have you ever thought about what a "collapsed selection" is? There's a whole world of front end behaviors and terminology you interact with every day you write content into a text input—you may just has never noticed.

Have you ever considered that if your caret is at the end of bold text and you keep typing, that it should be included in the bold text? But if your caret is at the end of more dynamic data, like a link, that link should probably not extend if you keep typing.

Along with open-sourcing the Portable Text Editor, the Portable Text specification is an open standard for describing rich text and block content in a way that separates presentation from its content. It is serializable to JSON and queryable with GROQ.

I really want to highlight how great the behvior API is ... to basically "open up" the editor. I can feel it myself when I work on it. I don't hard-code internal logic anymore. It's not only easier to do, it's easier to read, and it has fewer bugs!
— Christian Grøngaard

It was really great to speak with Christian about the challenges that he faced in extracting the editor from Sanity Studio and now releasing it as a standalone package. This was particularly interesting regarding the Behavior API and how it is not only a declarative API for users to interact with when using the package, but also the foundation for all of the core behaviors that ship with the Studio and a future where plugins will be able to interact with the package to extend the behavior in anybody's Portable Text Editor.

If there's anything you feel like we didn't cover in this episode or more you would like to know, reach out and let me know.