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

Convert JavaScript files to TypeScript #501

Merged
merged 8 commits into from
Aug 29, 2024

Conversation

phanect
Copy link
Contributor

@phanect phanect commented Aug 25, 2024

While most of the AstroWind code is written in TypeScript, there are still some JavaScript files in the repository.
This PR converts those JavaScript files to TypeScript and adds minimal typings.

This PR also includes the following changes:

  • Fix bugs detected by TypeScript
  • Remove rehype-plugin-image-native-lazy-loading and rewrote the same functionality
  • Remove deprecated Squoosh image service because it is warned by tsc

NOTES:

  • This PR includes changes for package-lock.json. Since it would probably conflict with Add GitHub Actions #499, please regenerate package-lock.json on your end, or let me regenerate it if it is required.
  • You might want to overwrite package-lock.json on your end to ensure I'm not an attacker to inject malicious code in package-lock.json.

@phanect phanect mentioned this pull request Aug 25, 2024
@phanect
Copy link
Contributor Author

phanect commented Aug 28, 2024

I have rebased this branch to resolve the conflicts.

@prototypa
Copy link
Contributor

Hi @phanect

Some question:

  • Why the decision to uninstall the rehype-plugin-image-native-lazy-loading plugin. I understand that the implementation is very simple but in the future some more functionalities could be added to this packages (if the lazy img specification increased).

@phanect
Copy link
Contributor Author

phanect commented Aug 28, 2024

@prototypa Thanks for the review!

  • Why the decision to uninstall the rehype-plugin-image-native-lazy-loading plugin.

Oops, I forgot to write the reason.
Because it does not include types (d.ts) and I couldn't migrate to TypeScript without removing it.

I considered to contribute to rehype-plugin-image-native-lazy-loading to add types, but I was not sure if the author accept my PR because this library is no longer maintained since 3 years ago.

@prototypa prototypa merged commit c047ce6 into onwidget:main Aug 29, 2024
4 checks passed
@phanect phanect deleted the feat-typescriptify branch August 29, 2024 21:46
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.

2 participants