Skip to content

Conversation

ValentinVignal
Copy link
Contributor

Fixes flutter/flutter#130817
Relates to flutter/flutter#122713

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 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.

@ValentinVignal ValentinVignal requested a review from chunhtai as a code owner July 19, 2023 10:10
@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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is very much inspired by path_to_regexp library, I don't know if I'm allowed to do that

Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "inspired by" mean? If you read the source of that package as part of writing this implementation, then no, that would disqualify you from contributing an implementation (in which case this PR should be closed).

Copy link
Contributor Author

@ValentinVignal ValentinVignal Jul 19, 2023

Choose a reason for hiding this comment

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

I did read the package source code to understand what was actually happening and how go_router_builder was using it.

I guess the PR cannot be merged as it is right now. Before closing it, let me try to clean it out and re-write something else.
But go_router_builder already has its methods built around it so it might end up looking similar anyway

Copy link
Collaborator

Choose a reason for hiding this comment

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

Before closing it, let me try to clean it out and re-write something else.

You cannot unsee the implementation, so any implementation you write will not be a clean room implementation, and would not satisfy licensing requirements.

Someone else will need to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I cannot work on this issue anymore? 😕

What if I find another way to code it that is not similar to the package? Would that work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I cannot work on this issue anymore? 😕

That is correct. We need a clean room implementation of the functionality this package needs, and you cannot provide that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct. We need a clean room implementation of the functionality this package needs, and you cannot provide that.

Even if as I suggested the implementation's logic is completely different? What would be the issue with that since it would explicitly not be inspired by the package?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even if as I suggested the implementation's logic is completely different? What would be the issue with that since it would explicitly not be inspired by the package?

I'm not a lawyer, and I have no interest in unnecessarily involving lawyers in the process of fixing the referenced issue.

@ValentinVignal
Copy link
Contributor Author

I believe this PR can have a no-test exemption. This is a revamp and the current tests should cover it already

@chunhtai
Copy link
Contributor

chunhtai commented Jul 19, 2023

we already have an implementation of the path util https://github.com/flutter/packages/blob/main/packages/go_router/lib/src/path_utils.dart you can just copy over

@ValentinVignal
Copy link
Contributor Author

we already have an implementation of the path util https://github.com/flutter/packages/blob/main/packages/go_router/lib/src/path_utils.dart you can just copy over

This is what I started to do at first but go_router_builder's needs are simpler so I felt it was overkilled. I can do that and stip out path_utils.dart to only what we need. But after @stuartmorgan 's comments, I don't know if I'll be allowed to make a PR

@stuartmorgan-g
Copy link
Collaborator

If you start from our code and do nothing but remove functionality, that should be fine, since you aren't creating anything. If you would need to write anything new, you should not, and in that case someone else should do it per the discussion above.

@ValentinVignal
Copy link
Contributor Author

ValentinVignal commented Jul 20, 2023

@chunhtai @stuartmorgan I've made another PR #4524 that should comply with what you want.
I copied path_utils.dart and only removed some methods from it or simplify some methods that were doing extra logic I didn't need.
I explained my steps with some comments on my commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[go_router_builder] Remove path_to_regexp
3 participants