-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[controversial] Breaking API proposal #594
Comments
@isoos how breaking would this be for the way we use |
Most of our markdown-internals are used only in https://github.com/dart-lang/pub-dev/blob/master/app/lib/shared/markdown.dart It seems to me that proposed changes won't break us much. We need to observe and create
so maybe some kind of configuration object that disables some of the syntax could be helpful. |
Hmm, interesting. We could. I don't really know what problem this solves. (I don't know if there are any users that are confused, or breaking changes we want to make, or that we've ever been hampered by releasing a breaking change with a major version bump.) Occasionally users have remarked in issues that they have implemented a syntax themselves, so I think the extensibility is in use. |
I think this is a totally fair point! Also why it's a controversial proposal :D It would allow us to implement
Is that a good thing? We're offering A LOT functionality for sure. But it's largely undocumented, and unclear what can be expected to work. The argument would be that: Promising a small set of stable features is better than offering a lot of functionality for which we don't intend to fix bugs (or even define behavior). Or if a certain constellation of syntaxes causes an infinite-loop, crash or stops working? Less is more.
Should anyone really make custom syntaxes? Wouldn't post-processing be better, like github does for:
|
In #585 I and later @srawlins sort of agreed that exposing
*Syntax
objects is probably a bad idea. We could document that, so consumers don't have to come to the same realization, or we could change the public API.This is a controversial proposal, feel free to shoot it down and close the issue.
It's certainly possible that some users might be hard to migrate.
Proposed public API
List<Node> markdown(String text, {options...})
functionResolver
.@Deprecated('Use the markdown() function')
Node
,Element
,Text
andResolver
.extension RenderHtml on List<Node> { String renderHtml(options...) {...} }
Next major version break
Node
withsealed class
Text
andElement
withfinal class
This would prevent users from trying to make custom
*Syntax
classes, reorderSyntax
classes, and get all sorts of weird behavior.It would also allow us to refactor the implementation and add new features without breaking existing users.
Maybe, we keep all the internals as they are, but exposing them to the public seems a bit scary.
The text was updated successfully, but these errors were encountered: