export DefaultEncoder #23

Closed
tommoor wants to merge 1 commit from patch-1 into master
tommoor commented 2025-12-11 03:55:59 +01:00 (Migrated from github.com)

Especially given the use of the typeId helper in the DefaultEncoder it is useful to have exported so we can create a new encoder with some methods changed.

Especially given the use of the typeId helper in the DefaultEncoder it is useful to have exported so we can create a new encoder with some methods changed.
marijnh commented 2025-12-11 07:59:21 +01:00 (Migrated from github.com)

No, I don't think this is worth exporting. It's 6 lines of very simple code, you can duplicate it at no cost.

No, I don't think this is worth exporting. It's 6 lines of very simple code, you can duplicate it at no cost.
tommoor commented 2025-12-11 12:19:29 +01:00 (Migrated from github.com)

It's not because of the typeID method, as explained

It's not because of the typeID method, as explained
marijnh commented 2025-12-11 12:50:42 +01:00 (Migrated from github.com)

True, it's actually ten lines. But still, making this something people can extend involves explaining how precisely it works so that people are able to correctly work with it and get their compare function right, and that still seems more complexity than it's worth.

True, it's actually ten lines. But still, making this something people can extend involves explaining how precisely it works so that people are able to correctly work with it and get their compare function right, and that still seems more complexity than it's worth.
tommoor commented 2025-12-11 13:08:50 +01:00 (Migrated from github.com)

involves explaining how precisely it works

Honestly this would be appreciated either way, the parameter is already there for folks to define their own encoder whether the default is exported or not and the docs are somewhat lacking around this.

> involves explaining how precisely it works Honestly this would be appreciated either way, the parameter is already there for folks to define their own encoder whether the default is exported or not and the docs are somewhat lacking around this.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-changeset!23
No description provided.