-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Describe the bug
If you have a proto file that doesn't have any reboot logic in it, it still generates an _rbt.js
file, but doesn't have much interesting in it.
This is not so much "bug" as point of confusion.
To Reproduce
Steps to reproduce the behavior:
- I had a giant
cheaoss.proto
file that I decided to split into smaller files (e.g.move.proto
,piece.proto
) - Some of those new smaller files don't have any reboot-ness to them (e.g.
move.proto
doesn't have any reboot state / methods) - in my
cheaoss_servicer.ts
file I changed from importing from.../cheaoss_rbt.js
to.../piece_rbt.js
and.../move_rbt.js
- Since
piece.proto
has reboot logic,.../piece_rbt.js
happily imported the moved messages. move.proto
, which has NO reboot logic,.../move_rbt.js
got red squiggly lines. Changing this to import from.../move_pb.js
worked just fine.- In addition, old
*_rbt_react.js
file remains even though that base.proto
file no longer has reboot logic (and since it wasn't regenerated, tries to import a lot of things that don't exist anymore)
Expected behavior
I would expect either
- For new
.proto
files, EITHER - the
_rbt.js
file doesn't get generated - the
_rbt.js
file still allows me to import the messages in that proto file. - for existing
.proto
files, if it longer contains reboot logic, the*_rbt_react.js
gets deleted - leaving it hanging means there's a lot stuff that "looks like" it still exists to use in React, but actually, one layer down, it's trying to import things that no longer exist.
In this instance where I was splitting a larger proto file and therefore a larger _rbt.js
file into smaller, slight preference for #2. In general, a little less clear to me what is preferable.
It looks like *_rbt_react.js
only gets generated for files that have react-logic, so this should probably do the same.
Impact
How severely does this bug impact your use of Reboot?
- It's not having any negative impact
- It's annoying
- It's a serious problem
- It makes it impossible for me to use Reboot
Please explain why?
A new dev to protobufs / reboot wouldn't really understand what files are generated "for protobufs" vs "for reboot" and just knows "reboot is generating some files."
The fact that I can import the new partial _rbt.js
same as the old larger _rbt.js
implies to me that I will import the same messages, but it does not. If it didn't exist, I would have considered looking at the other file instead (which is named _pb.js
which suggests it stores some protobuff-y stuff, so that's great!).
Client
Please complete the following information:
- Mac, VSCode 1.99.3