Closed fadeev closed 3 years ago
What's the state of this issue? Removing the repo/username from the package name should solve #745 is it still an issue frontend related?
@clockworkgr if we renamed scaffolded packages from hello.world.world
to world
(module name), how would that affect CosmJS type URL string. Will there be conflicts with other modules?
@ltacker do you see any problems we might encounter if we use short proto package names?
I'm asking for frontend since I don't have all the context on this side. Related to protobuf I don't see any problem, for Go package
is only used to avoid name clashing in not used in code generation: https://developers.google.com/protocol-buffers/docs/proto#packages
Btw if package
influences frontend code generation, wouldn't be possible to change that in the future and use an option
for the concerned feature?
Like Java for example:
In Java, the package is used as the Java package, unless you explicitly provide a option java_package in your .proto file.
@ltacker let's keep our proto package names long: user.repo.module
.
👍
I still want to know if package
affects the frontend because to solve https://github.com/tendermint/starport/issues/745 we could just add a prefix like "_" if the username starts with a number
@fadeev @clockworkgr
I don't think adding an underscore is an obvious solution. Maybe just omitting numbers.
A username can also be just numbers
True. I guess then having an underscore prefix is a good compromise. It is an edge-case, after all.
@ltacker let's keep our proto package names long:
user.repo.module
.
Right now if one scaffolds a chain:
They get a proto package
proto/world/*
that looks like thishello.world.world
(user, repo, module). And generated JS client is in./hello/world/hello.world.world
.Let's consider renaming this to
world
(module name), so that generated JS code will be in./hello/world/world
.The only issue I can think of is how will message types look like when sending through CosmJS. If a user scaffolds a module with a very common name, we don't want there to be conflicts with other (imported) modules.