Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jul 19, 2023

Convenient default factories for creating DOM element from a given tag name.

Required by flutter/flutter#130513

Part of flutter/flutter#127030

@mdebbar mdebbar requested a review from ditman July 19, 2023 20:15
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jul 19, 2023
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I think that if we exposed the constants of the default factory names from package:ui_web, the implementation would be slightly more robust (one less thing to have to worry about I guess?)


typedef _DefaultFactoryParams = Map<Object?, Object?>;

extension on _DefaultFactoryParams {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a wacky syntax we can get with extensions, I love it (in small doses) xD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually removed this because I was able to do the same thing using the existing readX extensions:

extension JsonExtensions on Map<dynamic, dynamic> {

@mdebbar mdebbar requested a review from ditman July 25, 2023 17:59
@mdebbar
Copy link
Contributor Author

mdebbar commented Jul 25, 2023

@ditman this is ready for a re-review!

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment about encapsulating the currently global consts inside the class that "owns" them, as static finals, if possible!

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 26, 2023
@auto-submit auto-submit bot merged commit 6f1c2df into flutter:main Jul 26, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 26, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 26, 2023
///
/// There's no need to register this view type with [PlatformViewRegistry]
/// because it is registered by default.
static const String defaultVisibleViewType = '_default_document_create_element_visible';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ and without the "k" prefix.

tumblr_70976177f0cdc973a43fba42c9c04621_20bc424a_400

LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 7, 2023
This wraps up the platform view improvements discussed in #127030.

- Splits `HtmlElementView` into 2 files that are conditionally imported.
- The non-web version can be instantiated but it throws if it ends up being built in a widget tree.
- Out-of-the-box view factories that create visible & invisible DOM elements given a `tagName` parameter.
- New `HtmlElementView.fromTagName()` constructor that uses the default factories to create DOM elements.
- Tests covering the new API.

Depends on flutter/engine#43828

Fixes #127030
@mdebbar mdebbar deleted the default_factories branch August 8, 2023 16:12
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…r#43828)

Convenient default factories for creating DOM element from a given tag name.

Required by flutter/flutter#130513

Part of flutter/flutter#127030
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants