Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.79k stars 860 forks source link

Migrate `CustomRender` to `HtmlExtension` #1176

Closed Sub6Resources closed 1 year ago

Sub6Resources commented 1 year ago

Closes #1142

Getting started on this. Here's a task list for myself. Any additional feedback/suggestions are still welcome.

Fixes #1137 Closes #717 Closes #1134 Closes #1105

Fixes #1206. Fixes #1199. Fixes #1180. Fixes #1113

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 77.09% and project coverage change: +5.76 :tada:

Comparison is base (c75e0df) 51.40% compared to head (3ed46cf) 57.16%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1176 +/- ## ========================================== + Coverage 51.40% 57.16% +5.76% ========================================== Files 19 36 +17 Lines 2640 2610 -30 ========================================== + Hits 1357 1492 +135 + Misses 1283 1118 -165 ``` | [Impacted Files](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker) | Coverage Δ | | |---|---|---| | [lib/src/anchor.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9hbmNob3IuZGFydA==) | `66.66% <ø> (ø)` | | | [lib/src/extension/helpers/image\_extension.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9leHRlbnNpb24vaGVscGVycy9pbWFnZV9leHRlbnNpb24uZGFydA==) | `0.00% <0.00%> (ø)` | | | [lib/src/extension/helpers/image\_tap\_extension.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9leHRlbnNpb24vaGVscGVycy9pbWFnZV90YXBfZXh0ZW5zaW9uLmRhcnQ=) | `0.00% <0.00%> (ø)` | | | [lib/src/style.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9zdHlsZS5kYXJ0) | `84.87% <0.00%> (ø)` | | | [lib/src/utils.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy91dGlscy5kYXJ0) | `77.27% <ø> (ø)` | | | [lib/src/builtins/details\_element\_builtin.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9idWlsdGlucy9kZXRhaWxzX2VsZW1lbnRfYnVpbHRpbi5kYXJ0) | `11.11% <11.11%> (ø)` | | | [lib/src/tree/styled\_element.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy90cmVlL3N0eWxlZF9lbGVtZW50LmRhcnQ=) | `23.68% <23.68%> (ø)` | | | [lib/src/extension/helpers/matcher\_extension.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9leHRlbnNpb24vaGVscGVycy9tYXRjaGVyX2V4dGVuc2lvbi5kYXJ0) | `53.84% <53.84%> (ø)` | | | [lib/src/builtins/interactive\_element\_builtin.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9idWlsdGlucy9pbnRlcmFjdGl2ZV9lbGVtZW50X2J1aWx0aW4uZGFydA==) | `54.76% <54.76%> (ø)` | | | [lib/src/extension/extension\_context.dart](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9leHRlbnNpb24vZXh0ZW5zaW9uX2NvbnRleHQuZGFydA==) | `55.17% <55.17%> (ø)` | | | ... and [20 more](https://app.codecov.io/gh/Sub6Resources/flutter_html/pull/1176?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

PritamSangani commented 1 year ago

Hi @Sub6Resources - is there anything the community can do to help get this PR finished and a new major version released?

Sub6Resources commented 1 year ago

Continuing from #1153

Sub6Resources commented 1 year ago

Migrating to Extension has touched pretty much all of the codebase, so I've taken the opportunity to remove some technical debt and fix bugs as I found them.

Here's a summary of major changes in this PR so far (this list is a work in progress):

Sub6Resources commented 1 year ago

This pull request is ready. Just needs some additional documentation on the Wiki. Anybody that's just stopping in, please review! I'd love to get this release out sometime tomorrow!

PritamSangani commented 1 year ago

There was a comment made on the initial extension api RFC issue about the name of the api, with Extension potentially being confusing and leading to conflicts with it being quite generic. A suggestion was made to change to something like HtmlExtension. I was wondering if you had any thoughts on this.

re: https://github.com/Sub6Resources/flutter_html/issues/1142#issuecomment-1333679864

Sub6Resources commented 1 year ago

@PritamSangani Thanks for pointing that out. I had forgotten about that comment (although I had named all the extension packages as if I had already made the change -- IframeHtmlExtension for example).

I agree! Just updated from Extension to HtmlExtension

Sembauke commented 1 year ago

congrats 🥳