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

client: Port to TypeScript #1457

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

client: Port to TypeScript #1457

wants to merge 19 commits into from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jul 29, 2023

No description provided.

@netlify
Copy link

netlify bot commented Jul 29, 2023

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit e2c447d
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/64d010f1df4c5400072a93c2

Copy link

netlify bot commented May 30, 2024

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit 132ecdf
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/677145d39e555400087ed28e

For some reason, ESLint’s `no-unused-vars` rule did not catch
that `PureApp` calls `EntriesFilter` until we switched to TypeScript.
react-router 6 expects state to be passed in the `state` property of the second argument.

I accidentally broke that in 88deede.
We really need static typing.
React 19 removes propTypes, which were deprecated since 2017:
https://19.react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-deprecated-react-apis

The recommended replacement is using TypeScript.

Given that the code base is a mess but dynamic nature of JavaScript
gives us little hope of cleaning it without introducing a ton of regressions
I have decided to bite the bullet.

In this commit, I mostly used https://www.npmjs.com/package/js-to-ts-converter

Additionally, I had to perform the following manually changes:

- Update references in `package.json`, `index.html` and `selfoss-base`.
- Switch to `typescript-eslint`.
- Declare `selfoss` inside `window`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant