Skip to content
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

[web] Ensure Flutter adds a generator meta-tag. #55714

Merged
merged 5 commits into from
Oct 14, 2024

Conversation

ditman
Copy link
Member

@ditman ditman commented Oct 7, 2024

Adds a meta name="generator" content="Flutter" tag when the engine UI initializes.

Issues

Fixes flutter/flutter#156262

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 Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

@ditman ditman requested review from yjbanov and mdebbar October 7, 2024 22:30
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 7, 2024
@ditman
Copy link
Member Author

ditman commented Oct 7, 2024

Added it here, instead of flutter.js so we can have a proper test for the feature.

@@ -229,6 +229,9 @@ Future<void> initializeEngineUi() async {
RawKeyboard.initialize(onMacOs: ui_web.browser.operatingSystem == ui_web.OperatingSystem.macOs);
KeyboardBinding.initInstance();

// Ensures Flutter renders a global "generator" meta-tag.
ensureMetaTag('generator', 'Flutter');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this in flutter.js so it's loaded asap?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, just saw your comment:

Added it here, instead of flutter.js so we can have a proper test for the feature.

I think we should add it to flutter.js if it's the more appropriate place for it. For testing, I think we have a couple of flutter.js tests already that we can steal ideas from. Alternatively, we can write an integration test on the flutter/flutter side. We're merging repos soon anyway, so the disadvantages of cross-repo testing will go away.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that flutter.js has the advantage of injecting the meta tag earlier, but I would like us to keep in mind that flutter.js is optional (is this not the case anymore?). So we still need to ensureMetaTag here to guarantee that the tag is always added.

If we want to add the meta tag in the absolute earliest moment, we could add it in index.html. But again, we still need to do it in initializeEngineUi as a backup.

@@ -229,6 +229,9 @@ Future<void> initializeEngineUi() async {
RawKeyboard.initialize(onMacOs: ui_web.browser.operatingSystem == ui_web.OperatingSystem.macOs);
KeyboardBinding.initInstance();

// Ensures Flutter renders a global "generator" meta-tag.
ensureMetaTag('generator', 'Flutter');
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that flutter.js has the advantage of injecting the meta tag earlier, but I would like us to keep in mind that flutter.js is optional (is this not the case anymore?). So we still need to ensureMetaTag here to guarantee that the tag is always added.

If we want to add the meta tag in the absolute earliest moment, we could add it in index.html. But again, we still need to do it in initializeEngineUi as a backup.

@ditman
Copy link
Member Author

ditman commented Oct 9, 2024

(Updating branch to re-test and autosubmit)

@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 11, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 11, 2024
Copy link
Contributor

auto-submit bot commented Oct 11, 2024

auto label is removed for flutter/engine/55714, due to - The status or check suite Mac mac_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@ditman
Copy link
Member Author

ditman commented Oct 14, 2024

(This branch has no mac-related changes)

@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 14, 2024
@auto-submit auto-submit bot merged commit cb51292 into flutter:main Oct 14, 2024
30 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 14, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 14, 2024
…156745)

flutter/engine@767be0a...cb51292

2024-10-14 [email protected] [web] Ensure Flutter adds a generator meta-tag. (flutter/engine#55714)
2024-10-14 [email protected] [Impeller] remove STB backend. (flutter/engine#55842)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-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
@ditman ditman deleted the web-add-generator-meta branch October 14, 2024 22:50
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
Adds a `meta name="generator" content="Flutter"` tag when the engine UI initializes.

## Issues

Fixes flutter#156262

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@ditman ditman added the cp: stable cherry pick to the stable release candidate branch label Jan 30, 2025
@ditman
Copy link
Member Author

ditman commented Jan 30, 2025

Attempting to cp this, it's making some internal work harder.

flutteractionsbot pushed a commit to flutteractionsbot/engine that referenced this pull request Jan 30, 2025
Adds a `meta name="generator" content="Flutter"` tag when the engine UI initializes.

## Issues

Fixes flutter/flutter#156262

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
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 cp: stable cherry pick to the stable release candidate branch platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[web] Add meta "generator" tag.
3 participants