Skip to content

[google_sign_in_web] Stop relying on framework internals. #5660

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

Merged
merged 5 commits into from
Dec 13, 2023

Conversation

ditman
Copy link
Member

@ditman ditman commented Dec 13, 2023

The private FlexHtmlElementView widget that backs the renderButton method currently relies on internal web engine knowledge (a CSS selector) to work.

This PR reimplements that bit of the FlexHtmlElementView so it uses standard framework APIs, and removes its reliance in undocumented behavior.

Issues

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with nits

@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 13, 2023
@auto-submit auto-submit bot merged commit b08f915 into flutter:main Dec 13, 2023
@ditman ditman deleted the flex-html-element-good-citizen branch December 13, 2023 20:27
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 14, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 14, 2023
flutter/packages@b5958e2...1151191

2023-12-14 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.8 to 3.22.11 (flutter/packages#5674)
2023-12-13 [email protected] [ci][web] Ignore always_specify_types for JSArray. (flutter/packages#5669)
2023-12-13 [email protected] [tool] Add support for `.java`, `.gradle`, `.sh`, and `.m` filesâ�¦ (flutter/packages#5567)
2023-12-13 [email protected] [google_sign_in] Update (web) example app. (flutter/packages#5634)
2023-12-13 [email protected] [path_provider] De-flake getExternalStorageDirectories test (flutter/packages#5628)
2023-12-13 [email protected] [google_sign_in_web] Stop relying on framework internals. (flutter/packages#5660)
2023-12-13 [email protected] [Android] Bump Gradle version to 7.6.3 (flutter/packages#5522)
2023-12-13 [email protected] [google_sign_in] Adopt code excerpts in README (flutter/packages#5521)
2023-12-13 [email protected] [css_colors] Adopt code excerpts in README (flutter/packages#5478)
2023-12-13 [email protected] [webview_flutter] Support for handling basic authentication requests (Android) (flutter/packages#5454)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit to flutter/engine that referenced this pull request Dec 21, 2023
This PR defers the injection of the contents of a Platform View into the DOM of the page, until the Platform View is really needed by a renderer.

This effectively means that a `platformView` will be injected into the DOM the first time that its `slot` is injected into the Shadow DOM of the Flutter web app.

This makes passing a `(flutter)ViewId` parameter from the framework unnecessary, even in a multi-view app.

The only cases in which this change might be breaking is those where an app tries to locate the just-created Platform View by looking into the DOM from the [`onPlatformViewCreated` callback](https://api.flutter.dev/flutter/widgets/HtmlElementView/onPlatformViewCreated.html). In those cases, [a fix like this](flutter/packages#5660) is needed (use the **only [documented way](https://api.flutter.dev/flutter/dart-ui_web/PlatformViewRegistry/getViewById.html)** to obtain the Platform View contents from its `viewId`)

## Issues

Fixes flutter/flutter#137287
Closes flutter/flutter#136548

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@reidbaker reidbaker mentioned this pull request Jan 12, 2024
auto-submit bot pushed a commit to flutter/cocoon that referenced this pull request Jan 25, 2024
Cocoon's dependabot seems to be ignoring "patch" (`+z`) releases in packages with version < `1.0.0`.

That's caused them to miss [a fix in how the Google Sign In button renders into the app](flutter/packages#5660) that was released as a "patch" version (`0.12.3+1`).

This PR updates the cocoon dependency to the fixed version of the package, so the Google Sign In button renders normally again.

(It also uses a new API introduced in 0.12.3 to access `web_only` components much more easily than before, which allows to remove an intermediate dependency).

## Issues

* Fixes flutter/flutter#142195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: google_sign_in platform-web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants