-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add classes containing path params and query params as const #1
feat: add classes containing path params and query params as const #1
Conversation
1 - Fonctions ajoutées dans le dernier commit 👍 2 - Pour ce point-ci, ClassQueryParams gérait uniquement les query params, un peu plus bas il y avait l'équivalent pour les path params, justement dû au formatage différent des params et pour les distinguer plus clairement à l'utilisation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erreurs au run du build_runner
exécuté coté utilisation de la lib, avec la dep set pour la branche feat/add-const-for-query-path-params
, dep qui s'est résolue au commit a27cade :
[SEVERE] go_router_builder on lib/modules/navigation/routes/scaffold_shell_routes.dart (cached):
An error `FormatterException` occurred while formatting the generated source for
`package:flutter_b2c/modules/navigation/routes/scaffold_shell_routes.dart`
which was output to
`lib/modules/navigation/routes/scaffold_shell_routes.go_router.g.part`.
This may indicate an issue in the generator, the input source code, or in the
source formatter.
Could not format because the source could not be parsed:
line 279, column 29 of .: Expected to find ';'.
╷
279 │ static const String tag = ''tag'';
│ ^^
╵
J'ai creusé la cause : route_config.dart:405
et route_config.dart:427
: escapeDartString
fourni déjà des quotes autour de la String, elle se retrouvent donc en double dans la String générée aux lignes indiqués.
J'ai fais un petit code de test pour être sûr et éliminer toute suspicion possible de gestion de dépendance ou autres :
- Depuis ce repo, sur le commit a27cade
import 'package:go_router_builder/src/route_config.dart';
void main() {
String testQueryParam = "testQueryParam";
String testPathParam = "testPathParam";
String formatedQueryParam = GoRouteConfig.formatQueryParams(testQueryParam);
String formatedPathParam = GoRouteConfig.formatPathParams(testPathParam);
print(formatedQueryParam);
print(formatedPathParam);
String content =
"static const String ${testQueryParam} = '${formatedQueryParam}';\n";
print(content);
content = "static const String ${testPathParam} = '${formatedPathParam}';\n";
print(content);
}
Ce qui donne l'output :
En accord avec les erreurs ci-dessus au run du build_runner
.
Est-ce que tu peux donner les droits "admin" à la team mobile sur ce repo s'il te plait ? |
Create a fork of GoRouterBuilder to add classes containing query param and path param as const to use in Epicery b2c app in this PR to match with GoRoute params map to send analytics event with those params' value.
Following this comment:
fork/go-router-builder
rebased on GoRouterBuilder latest release (commit 1520ffb) and reset to head to keep its name and serve as base for PRfeat/add-const-for-query-path-params
created with previous commit cherry-picked fromfork/go-router-builder
before reset