Skip to content

protos with no reboot logic/options in it still generates a rbt.js file #24

@katfang

Description

@katfang

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:

  1. I had a giant cheaoss.proto file that I decided to split into smaller files (e.g. move.proto, piece.proto)
  2. 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)
  3. in my cheaoss_servicer.ts file I changed from importing from .../cheaoss_rbt.js to .../piece_rbt.js and .../move_rbt.js
  4. Since piece.proto has reboot logic, .../piece_rbt.js happily imported the moved messages.
  5. 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.
  6. 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

  1. For new .proto files, EITHER
  2. the _rbt.js file doesn't get generated
  3. the _rbt.js file still allows me to import the messages in that proto file.
  4. for existing .proto files, if it longer contains reboot logic, the *_rbt_react.js gets deleted
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions