Repository navigation
chore(swift): version packages (0.2.0) - #147
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
swift-release/version
branch
5 times, most recently
from
November 14, 2026 16:40
8723878 to
f1dda09
Compare
github-actions
Bot
force-pushed
the
swift-release/version
branch
from
November 14, 2026 16:52
f1dda09 to
ddb5b7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging this releases lexical-swift 0.2.0: the Swift Release workflow then publishes the mirror, the tag and the GitHub release.
Conforms to upstream Lexical 0.53.0 (
UPSTREAM_VERSION).Minor Changes
Breaking: pasted and dropped files are no longer read into memory on the main thread. As a web
Fileis a lazyBlob, aDataTransferFilenow has asizeand reads its contents only when a handler awaitsbytes(), off the main thread, so a paste or drop of large files no longer blocks the view, even when no handler wants the files.DataTransferFile.datais gone, and the type is no longerEquatable.To migrate, read a file's contents with
try await file.bytes()where you readfile.data, as upstream'smediaFileReaderawaits eachFile. ADRAG_DROP_PASTEhandler that needs the bytes returnstrueand reads them in aTask.DataTransferFile(name:type:data:)still makes a file in memory, andDataTransferFile(name:type:size:load:)makes a lazy one. Compare files bynameandtypewhere you compared them with==.On macOS, a dropped or pasted file is read from its URL; an image on the pasteboard with no file behind it is read from the pasteboard and throws once the pasteboard has changed. On iOS, UIKit lets items load only during the paste or drop, so each file starts loading into a temporary file then,
bytes()waits for it, andsizeisnil. iOS drops and pastes now also carry files that aren't images, such as a PDF from Files, which were lost before.[breaking] The
@LexicalNodeand@Fieldmacros move out ofLexicalinto a new, optionalLexicalMacrosproduct, so an app that doesn't use them no longer builds swift-syntax, and Xcode no longer asks to trust a macro (or needs-skipMacroValidation) forLexical. A node can declare itsconfig()without them, with aNodeConfigand aSchemaFieldper property, as JS's$configdoes; the README's Custom nodes section shows both forms. To keep using the macros, add.product(name: "LexicalMacros", package: "lexical-swift")to the target (in Xcode, the LexicalMacros package product) andimport LexicalMacrosnext toimport Lexicalin each file that uses them.lexical-swiftrequires Swift 6.4 (Xcode 27) again, as it did before 0.1.9. Xcode 27 runs on macOS Tahoe 26.6 or later, so an app that builds with Xcode 26.5 or 26.6 moves to Xcode 27, or stays onlexical-swift0.1.10 with.upToNextMinor(from: "0.1.10"). It still accepts swift-syntax 603 as well as 604.LexicalEditor.configure { textView in ... }sets up the text view (LexicalUITextViewon iOS,LexicalNSTextViewon macOS, namedLexicalEditor.TextView) each time SwiftUI updates the editor, after the editor's own settings: the text container's inset and padding, exclusion paths, the accessibility label, the macOS insertion point color. It runs on every update, so it can read SwiftUI state and must set the same values each time; register commands and listeners on the editor instead. WithsizedToContent,LexicalEditornow measures its content at the width SwiftUI proposes without resizing the text view it is measuring.Themes take an app's own colors and change on a live view.
TextKitColor(uiColor:)andTextKitColor(nsColor:)make a theme color from aUIColororNSColor, keeping a dynamic color's light and dark variants (a high-contrast variant draws as its regular one), soTextKitColor(uiColor: .label)or a SwiftUIColorthroughUIColor(_:)follows the appearance.LexicalUITextViewandLexicalNSTextViewhave athemeproperty that draws the text again when set to a different theme, asLexicalEditor.theme(_:)already did, which now sets it. To keep a theme's sizes fixed on iOS instead of scaling with Dynamic Type, pin the size category with.dynamicTypeSize(.large)onLexicalEditorortraitOverrides.preferredContentSizeCategory = .largeon the view.Patch Changes
LexicalUITextViewandLexicalNSTextViewfolloweditor.setEditable(_:): they are editable only while the editor is, asContentEditablesetscontentEditable, and a read-only editor takes no typing, deleting, cutting, pasting, dropping or check box toggles, only clicks, copies and drags of its selection, as on the web. Before,setEditable(false)left the views editable and input still changed the document.