Skip to content

[webview_flutter_platform_interface][webview_flutter_wkwebview] Fix inconsistent imports #3427

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 1 commit into from
Mar 9, 2023

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Mar 9, 2023

Pushing the plugin internally causes errors from these imports. This fixes them to follow the convention of all the other imports.

This is only changing imports so not tests and no version bump.

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.

@bparrishMines bparrishMines requested a review from cyanglaz as a code owner March 9, 2023 16:59
@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 (don't just cc him here, he won't see it! He's on Discord!).

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.

@bparrishMines bparrishMines changed the title update bad imports [webview_flutter_platform_interface][webview_flutter_wkwebview] Fix inconsistent imports Mar 9, 2023
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

I wonder how that Dart code even compiled; it has an extra level of ../ unless I'm misreading it.

@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Mar 9, 2023
@bparrishMines bparrishMines added autosubmit Merge PR when tree becomes green via auto submit App and removed needs tests labels Mar 9, 2023
@bparrishMines
Copy link
Contributor Author

I think it's correct assuming../../ takes you to the lib folder.

@stuartmorgan-g
Copy link
Contributor

I think it's correct assuming../../ takes you to the lib folder.

But the file it's in is webview_flutter_platform_interface/lib/src/platform_webview_controller.dart; ../.. should just be webview_flutter_platform_interface.

@bparrishMines
Copy link
Contributor Author

Ah, I see what you mean now.

Just tested it and turns out that all of these are valid:

import '../src/platform_navigation_delegate.dart';
import '../../src/platform_navigation_delegate.dart';
import '../../../src/platform_navigation_delegate.dart';
import '../../../../src/platform_navigation_delegate.dart';
import '../../../../../src/platform_navigation_delegate.dart';

@bparrishMines
Copy link
Contributor Author

This fails though:

import '../../lib/src/platform_navigation_delegate.dart';

I think the compiler considers lib as the root folder. So any number of ../ will just equal the root folder. Same with bash.

@auto-submit auto-submit bot merged commit 574b8ea into flutter:main Mar 9, 2023
@bparrishMines bparrishMines deleted the bad_imports branch March 10, 2023 14:13
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 10, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
[webview_flutter_platform_interface][webview_flutter_wkwebview] Fix inconsistent imports
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 override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: webview_flutter platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants