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

codegen: move templates comments from generated code #3463

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

a8m
Copy link
Collaborator

@a8m a8m commented Dec 30, 2024

Template comments should not be included in the generated assets (it repeats itself for every arg).

cc @giautm

@a8m a8m requested a review from StevenACoffman December 30, 2024 14:16
@coveralls
Copy link

Coverage Status

coverage: 73.889% (-0.03%) from 73.915%
when pulling 0f87d1d on templcomment
into 4b06405 on master.

@a8m
Copy link
Collaborator Author

a8m commented Dec 30, 2024

Also, something a bit worrying is that the latest upgrade significantly increases the size of the generated code. See this PR as an example (from 15K to 21K): https://github.com/ent/contrib/pull/607/files
image

@StevenACoffman
Copy link
Collaborator

Ah, oops. Yeah, that's a good call. Not sure about the codegen size increase source (just more comments?).

@StevenACoffman StevenACoffman merged commit 400e6c8 into master Dec 30, 2024
18 checks passed
@StevenACoffman StevenACoffman deleted the templcomment branch December 30, 2024 15:58
@a8m
Copy link
Collaborator Author

a8m commented Dec 30, 2024

Not sure about the codegen size increase source (just more comments?).

See the PR example I shared above.

@StevenACoffman
Copy link
Collaborator

StevenACoffman commented Dec 30, 2024

Sorry, I was unclear in my comment.
In https://github.com/ent/contrib/pull/607/files github.com/99designs/gqlgen was moved from v0.17.48 to v0.17.51

In that PR, I see that entgql/internal/todo/generated.go went from 15K to 21K lines, but it was not clear to me if the comments fully accounted for the difference and this PR fully fixes the issue.

@StevenACoffman
Copy link
Collaborator

@a8m @michaelcaulley @vitorfalcaor Thanks for your work!

Also in https://github.com/ent/contrib/pull/607/files github.com/99designs/gqlgen was moved from v0.17.48 to v0.17.51.

I see that in that PR it has a comment that says that gqlgen version v0.17.52 has an issue with ent field collection. It blames commit: f81239e

The blamed gqlgen commit was merged #3287
This was to fix #3285 by reverting #3203

Currently gqlgen v0.17.61 is the latest. It is not clear to me if there remains any problem with gqlgen and ent field collection.
Please point me to an open issue in gqlgen (or PR) describing (or fixing) the ent field collection problem.

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

Successfully merging this pull request may close these issues.

4 participants