hilla icon indicating copy to clipboard operation
hilla copied to clipboard

Rename the internal Pageable so it does not show up for the user

Open Artur- opened this issue 3 years ago • 2 comments

Description of the bug

When auto complete the import for Pageable you end up with a choice: Should you use dev.hilla.mappedtypes.Pageable or org.springframework.data.domain.Pageable. We should rename dev.hilla.mappedtypes.Pageable to MappedPageable or InternalPageable or something so it does not show up as an option. Still the TS generator should use Pageable for the generated code.

Artur- avatar Apr 08 '22 10:04 Artur-

I'm not sure that renaming internal Pageable is a good idea because now the generator (both old and new) does not support name mapping. It just uses the full class name it received.

I came to two options here:

  • We could try using specific part in the pacakage name, like dev,hilla.mappedtypes.internal.Pageable or dev.hilla.mappedtypes.noapi.Pageable. The same approach used by ClassGraph and I would say it is pretty clear that I shouldn't use the part inside noapi package.
  • We could try to use some features provided by the Java 9 module API. I haven't tried it yet but Idea have nothing against the following code:
    module dev.hilla.mappedtypes {
        exports dev.hilla.mappedtypes to dev.hilla.generator;
    }
    
    Though it would work only in Java 9+ environment.

Lodin avatar Apr 12 '22 12:04 Lodin

I'm not sure that renaming internal Pageable is a good idea because now the generator (both old and new) does not support name mapping

That is exactly what this issue is about. To support that :)

Changing the package name does not help, you still have two options to choose from. The problem is not that you do not understand which to pick (well it is a smaller problem), the problem is that typing Pagea and completing it shows more than one option.

Artur- avatar Apr 12 '22 12:04 Artur-