Skip to content
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

Pre-generation of signature caches #115

Closed
boesing opened this issue May 2, 2022 · 2 comments
Closed

Pre-generation of signature caches #115

boesing opened this issue May 2, 2022 · 2 comments

Comments

@boesing
Copy link
Contributor

boesing commented May 2, 2022

Hey there,

I recently started to use this library.
I was thinking of actually writing a CLI command for CI pipeline which searches for the TreeMapper#map usage and parses the 1st argument (FQCN) from it.

I do want to pass this FQCN to the TypeParser#parse method so that the cacheDirectory entry is being created.

What I found out is, that there is no way to actually get an instance of the TypeParser and I do really would love to avoid instantiating it by myself.

Do you have an idea and/or suggestion on how to retrieve the TypeParser instance with the settings I do pass to the MapperBuilder?

Would love to get some help here so we can pre-generate the cache entries on the filesystem during build-time.

Thanks in advance 🤙🏼

@romm
Copy link
Member

romm commented May 3, 2022

Hi @boesing, I did not give access to the container instance on purpose to avoid giving access to everything (which would result in more maintenance burden).

However, this is a good suggestion, and a part of this feature could even be part of the public API provided by the library, maybe something like MapperBuilder::warmup(SomeClass::class, SomeOtherClass::class). I'd be happy to help/review if you were to add this to the core of the library. 🙂

boesing added a commit to boesing/Valinor that referenced this issue May 3, 2022
This adds `MapperBuilder#warmup` as suggested in CuyZ#115.
By using this method, the types will be parsed from the provided class-string arguments and pre-cached using the `ClassDefinitionRepository#for` method.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing changed the title Access to the container via MapperBuilder Pre-generation of signature caches May 5, 2022
boesing added a commit to boesing/Valinor that referenced this issue May 16, 2022
This adds `MapperBuilder#warmup` as suggested in CuyZ#115.
By using this method, the types will be parsed from the provided class-string arguments and pre-cached using the `ClassDefinitionRepository#for` method.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
romm pushed a commit to boesing/Valinor that referenced this issue May 23, 2022
This adds `MapperBuilder#warmup` as suggested in CuyZ#115.
By using this method, the types will be parsed from the provided class-string arguments and pre-cached using the `ClassDefinitionRepository#for` method.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@romm
Copy link
Member

romm commented May 23, 2022

Closed with #116.

@romm romm closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants