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

Change typescript module to nodenext #32757

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Dec 8, 2024

Typescript 5.7 changed semantics around JSON imports and nodenext is now treated differently than node16 for JSON imports and it requires the import attribute, so change the value to that and add the attribute to eliminate this typescript error.

moduleResolution is treated as an alias when module is nodenext, so we don't need to specify it.

Also see microsoft/TypeScript#60589. It appears the next Typescript release will fix this for node16, but I guess it'll still be good to switch to nodenext.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 8, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 8, 2024
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Dec 8, 2024
@silverwind
Copy link
Member Author

silverwind commented Dec 9, 2024

Typscript will be adding more suitable node targets like node18 in 5.8. Until then, nodenext is the next best module option we can use.

@silverwind silverwind changed the title Change typescript module to nodenext Change typescript module to nodenext Dec 9, 2024
@wxiaoguang
Copy link
Contributor

Is nodenext experimental? If yes, is it urgent to introduce it?

@silverwind
Copy link
Member Author

silverwind commented Dec 9, 2024

Is nodenext experimental? If yes, is it urgent to introduce it?

As per TS docs, nodenext is recommended:

You very likely want "nodenext" for modern Node.js projects and preserve or esnext for code that will be bundled.

In typescript 5.8 we can switch it to node18, but that option does not exist yet in 5.7.

It is urgent in the sense that if we want tsc to be clean, we have to use nodenext, because under node16, it's not possible to be clean while having a json import present.

@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 Dec 9, 2024
@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 Dec 10, 2024
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 10, 2024
@silverwind silverwind enabled auto-merge (squash) December 10, 2024 08:39
@silverwind silverwind merged commit d061f6b into go-gitea:main Dec 10, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Dec 10, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 10, 2024
silverwind added a commit to silverwind/gitea that referenced this pull request Dec 10, 2024
* origin/main:
  Fix internal server error when updating labels without write permission (go-gitea#32776)
  Fix wiki ui (go-gitea#32781)
  Change typescript `module` to `nodenext` (go-gitea#32757)
  Refactor issue filter (labels, poster, assignee) (go-gitea#32771)
  Make RepoActionView.vue support `##[group]` (go-gitea#32770)
  [skip ci] Updated translations via Crowdin
@lunny lunny modified the milestones: 1.24.0, 1.23.0 Dec 10, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 11, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Use batch database operations instead of one by one to optimze api pulls (go-gitea#32680)
  Fix internal server error when updating labels without write permission (go-gitea#32776)
  Fix wiki ui (go-gitea#32781)
  Change typescript `module` to `nodenext` (go-gitea#32757)
  Refactor issue filter (labels, poster, assignee) (go-gitea#32771)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants