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

Fix types for npm packages #1794

Closed

Conversation

irshadahmad21
Copy link

@irshadahmad21 irshadahmad21 commented Feb 10, 2024

Fixes #1793 #1770

This PR:

  • Changes the build tool from ESBuild to Tsup
  • Ensures that correct types are produced on build
  • Fixes the exports in package.json for all the TS packages

Using the arethetypeswrong CLI, here are the before and after results

BEFORE AFTER
@inertiajs/core
Screenshot 2024-02-10 at 9 47 32 PM Screenshot 2024-02-10 at 9 52 06 PM
@inertiajs/react
Screenshot 2024-02-10 at 9 47 57 PM Screenshot 2024-02-10 at 9 52 20 PM
@inertiajs/vue2
Screenshot 2024-02-10 at 9 48 17 PM Screenshot 2024-02-10 at 9 52 32 PM
@inertiajs/vue3
Screenshot 2024-02-10 at 9 48 34 PM Screenshot 2024-02-10 at 9 52 45 PM

Next steps

  • Update typescript and @types/react* to the latest version
  • Get rid of a few // @ts-expect-error comments

@irshadahmad21
Copy link
Author

It's getting difficult to work with Inertia with broken types. Lots of TS errors and broken auto-completions on modern TS stack.

Can we please have a look at this and ship it as soon as we can?

CC: @reinink @claudiodekker @jessarcher

@irshadahmad21
Copy link
Author

Had to rebase to resolve conflicts in lockfile

@irshadahmad21
Copy link
Author

irshadahmad21 commented Apr 5, 2024

@reinink @claudiodekker @jessarcher

Is there any possibility of this landing anytime soon?

If not, then is it fine to create a fork and publish to npm to temporarily solve the problem for our team(s)?

@jrson83
Copy link

jrson83 commented Apr 9, 2024

@irshadahmad21 could you please contact me on the inertia discord jrson83 or by mail just@jrson.me.

@irshadahmad21
Copy link
Author

irshadahmad21 commented Apr 10, 2024

For keeping this hanging for 2 months and from Inertia Discord discussions, it seems like the issue is not even acknowledged and this tooling update is rather considered a "major rewrite" which is "highly unlikely" to land. Thus we are no longer interested in this.

@irshadahmad21 irshadahmad21 deleted the fix/ts-types-for-npm branch April 10, 2024 12:50
@reinink
Copy link
Member

reinink commented Apr 16, 2024

@irshadahmad21 Hey definitely not trying to ignore, we've actually been busy lately trying to get on top of issues (thanks a bunch to @driesvints for all his help here), and we've actually talked about this PR internally. This project has a lot of moving parts and so we need to be careful when making changes, plus I work on this project in my free time, so things often take months, not weeks or days. Honestly doing my best 😕

I also don't know much about tsup, but I am familiar with ESBuild, so making this change required me to do some homework first before changing a key part of our tooling.

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.

TypeScript types are not exported properly
3 participants