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

Is it really needed to use all Play dependencies? #46

Open
felipebonezi opened this issue Oct 27, 2022 · 1 comment
Open

Is it really needed to use all Play dependencies? #46

felipebonezi opened this issue Oct 27, 2022 · 1 comment
Labels
help wanted Hey, help me here! question A question to be answered by the community.

Comments

@felipebonezi
Copy link
Collaborator

I was reviewing the project and realized that we're using all Play modules defined into project/plugin.sbt.

We could improve our dependency to Play only using the exact module that we need.
The two main problems we will suffer is that we use Results.Result as the main return from PdfGenerator.ok(...) as we can see at here and play.Environment as the helper class to get all resources (e.g. Images, CSS, etc) files from public folder.

From my research I see that we're using the following modules:

I believe that we could remove this method and return only byte[] and InputStream as the available returns to render the PDF and implement another way to get the resources from the public folder (maybe using something very similar to play.Environment implementation).

The benefits we could have are:

  • Do not have to maintain all related modules from Play updated;
  • Do not be exposed to all bugs related to all modules from Play;
  • Significantly reduce the size of the project.

The malicious we could have:

  • It's a breaking change feature, so, a Migration Guide is needed and could be not well received by the users;
  • We couldn't know how to implement a good solution to get all resources files from public folder.

Hope to hear more opinions.

@felipebonezi felipebonezi added help wanted Hey, help me here! question A question to be answered by the community. labels Oct 27, 2022
@braviusconolly
Copy link

I agree and would say that we could use a helper class to get resources files using java.util.File from public folder.
It seems to be a very simple implementation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Hey, help me here! question A question to be answered by the community.
Projects
None yet
Development

No branches or pull requests

2 participants