Skip to content

Fix various problems #35012

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

Merged
merged 5 commits into from
Jul 9, 2025
Merged

Fix various problems #35012

merged 5 commits into from
Jul 9, 2025

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Jul 9, 2025

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 9, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Jul 9, 2025
@wxiaoguang wxiaoguang added backport/manual No power to the bots! Create your backport yourself! backport/v1.24 This PR should be backported to Gitea 1.24 labels Jul 9, 2025
@wxiaoguang
Copy link
Contributor Author

image

image

@wxiaoguang wxiaoguang added the backport/done All backports for this PR have been created label Jul 9, 2025
} else {
throw e;
}
}
Copy link
Member

@silverwind silverwind Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: So we are waiting for DOMContentLoaded until we load this chunk from the network? I think this will cause unnecessary delay and we could start this load earlier and only actually execute the code on DOMContentLoaded.

Copy link
Contributor Author

@wxiaoguang wxiaoguang Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The waiting time is almost the same as the old approach : index.js before </body></html>.

But yes, we can start the import immediately, and only "init" in DOMContentLoaded, it needs to make the index-domready expose its init function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do that together after this htmx bug gets fixed:

image

Copy link
Member

@silverwind silverwind Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no major benefits to this 2-chunk approach, maybe we should have all main JS in one chunk only. It's simpler design and whether the browser loads 1MB vs. 1.3MB makes no practical difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think we can merge them into one index.js and load it in the <head>, total size is about 2.7MB

Copy link
Member

@silverwind silverwind Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That value seems off. In 1.24 I see much lower sizes:

image

Copy link
Contributor Author

@wxiaoguang wxiaoguang Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That value seems off. In 1.24 I see much lower sizes:

If it is, which part makes the new index.js so large? #34960 (comment)

Or the size difference is caused by different packing options? production vs dev?

Copy link
Member

@silverwind silverwind Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes likely you are seeing dev values. Dev JS is not minified:

minimize: isProduction,

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 9, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 9, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) July 9, 2025 16:20
@wxiaoguang wxiaoguang merged commit 211135b into go-gitea:main Jul 9, 2025
26 checks passed
@wxiaoguang wxiaoguang deleted the fix-various branch July 9, 2025 16:48
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 10, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Docs/fix typo and grammar in CONTRIBUTING.md (go-gitea#35024)
  fix: improve english grammar and readability in locale_en-US.ini (go-gitea#35017)
  Add labeler config for `topic/code-linting` (go-gitea#35020)
  Fix various problems (go-gitea#35012)
  Fix the response format for `actions/workflows`. (go-gitea#35009)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read properties of null (reading 'length')
4 participants