Skip to content

Conversation

@TheOneWithTheBraid
Copy link

Implemented a getter exposing the currently present UrlStrategy for the web platform as part of flutter_web_plugins.
This is e.g. required to fix the below-stated issue in the url_launcher which is not able to properly encode an in-app URL inside an HTML anchor element's href.

List which issues are fixed by this PR. You must list at least one issue.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

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, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the 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.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@mdebbar
Copy link
Contributor

mdebbar commented Sep 30, 2021

If the app never calls setUrlStrategy(), the web engine will create a default url strategy (see here and here). In this case, your _urlStrategy remains null.

@TheOneWithTheBraid
Copy link
Author

TheOneWithTheBraid commented Oct 1, 2021

In case there's no call of setUrlStrategy, wouldn't it be nicer anyway if the EngineFlutterWindow directly called setUrlStrategy instead of the hard-coded UrlStrategy in _createDefaultUrlStrategy in https://github.com/flutter/engine/blob/2db431944795e9c556881d77cfefe7159bb58168/lib/web_ui/lib/src/engine/window.dart#L358?

Well, that would harm the tree hygiene as it meant a call from engine to flutter_web_plugins.

The other way would be keeping in sync the default UrlStrategy as already pointed out in

// https://github.com/flutter/engine/blob/custom_location_strategy/lib/web_ui/lib/src/engine/navigation/js_url_strategy.dart

@TheOneWithTheBraid
Copy link
Author

I am unsure whether / how I can cover the affiliation with https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/window.dart#L360 in a test. Do you have an idea of it?

@TheOneWithTheBraid
Copy link
Author

@mdebbar Does it look eligible now?

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

LGTM

@mdebbar
Copy link
Contributor

mdebbar commented Oct 11, 2021

I'm not sure why some of the checks are stuck. You may need to rebase and push to get them to run again.

@TheOneWithTheBraid
Copy link
Author

TheOneWithTheBraid commented Oct 12, 2021

It looks like the framework_tests-misc-linux does not like to pass even though I rebased. Do you have an idea why?

@mdebbar
Copy link
Contributor

mdebbar commented Oct 12, 2021

I think something went wrong with the rebase and we ended up with 140 commits. The PR in its current form is not going to work, it needs to be cleaned up.

Do you remember how you rebased? It might help us get things back to normal.

If you can get back to a state that only contains your commits, we can redo the rebase correctly. If you aren't too familiar with git, let me know and I'll help.

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

PR needs clean up before submitting.

@TheOneWithTheBraid
Copy link
Author

Should be squashed now. Could you check whether it's fine now, @mdebbar?

@mdebbar
Copy link
Contributor

mdebbar commented Oct 12, 2021

Alright, squashing did it 😄

Let's wait and see what the tests have to say.

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

Everything is green and ready to go!! 🎉

@jmagman jmagman removed their request for review October 12, 2021 17:47
@fluttergithubbot fluttergithubbot merged commit 01afd64 into flutter:master Oct 13, 2021
@TheOneWithTheBraid TheOneWithTheBraid deleted the url-strategy-getter branch October 13, 2021 17:54
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants