-
Notifications
You must be signed in to change notification settings - Fork 357
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 React-Table to TypeScript #1950
Comments
|
Hi @priley86, do you have an ETA for this? We are trying to use react-table with TypeScript and we get errors about declaration files. Also looks like you need to use the latest version of react-core. node_modules/@patternfly/react-table/dist/js/components/Table/index.d.ts(20,49): error TS7016: Could not find a declaration file for module './ExpandableRowContent'. 'C:/GitHub/keycloak/themes/src/main/resources/theme/keycloak-preview/account/resources/node_modules/@patternfly/react-table/dist/js/components/Table/ExpandableRowContent.js' implicitly has an 'any' type. |
hi @ssilvert 👋 i'm guessing we'll be able to introduce this in the next few sprints - currently still trying to resolve a few other things downstream on my side. I'll probably be able to attempt this next week though. As far as I can tell, we'll need |
Hi @priley86, I created a reproducer for you. Just grab this branch of my simple patternfly/systemjs app. If you run 'npm run build' you will see the TypeScript errors. If this is going to take much longer, can we start thinking about a temporary solution where we just provide some simple .d.ts files? We do need to get past this soon and I'm not 100% sure that the issue with the UMD distribution #1966 is really fixed. We haven't been able to test it. Thanks. cc: @dgutride @pedroigor |
hi @ssilvert, thanks for following up w/ this (it gives a better glimpse of what you are looking at). Regarding the typescript definitions to This is a large effort and has certainly been a background task for me, and i'll likely not be able to convert all components until late July timeframe due to other efforts. We'd also need to test this conversion in multiple products now consuming react-table (as well as changes to react-core). You can certainly tweak this PR or consume a personal fork of this in the interim. If you need a faster response, maybe you can ask someone working actively in the PF Dev Squad? I'm happy to help fully test this later on once we can integrate in products. Regarding UMD/this build though, I believe your build configuration is quite different from many products I've worked w/ recently using Webpack. I don't know that many teams are using UMD modules (most have moved to ESM), but certainly appreciate you helping us add that support. I'm not working on a UMD based project currently and would probably struggle to help you maintain this, but you might consider contributing your SystemJS project to PatternFly in some way? This also might be a good candidate for the patternfly-react-seed. cc: @seanforyou23 HTH! |
+1 for adding |
We have used this build config from the beginning and we don't have any problems with I want my code to produce as few runtime errors as possible. So it is advisable to keep You might be able to suppress the The reason we need UMD instead of ESM is because we are targeting ES5. Using ESM would require transpiling everything in the browser, which slows down the app. If we used Webpack it wouldn't be a problem but.... We can't use Webpack in our app. We need to allow customers to just put javascript on the file system and have that code added to the app. So this app needs to discover and then dynamically load javascript modules at runtime. Using a bundler like Webpack won't work. (Or at least, I don't know how to achieve that with Webpack. The customer should not need to know about or use Webpack at all.) I would be happy to contribute my little project to PatternFly. Just need to talk to someone about how we want to do it. |
@priley86 Last but not least, where are we now? Have you been able to get rid of some or all of the errors when transpiling my project? |
@priley86 What is the status of this? Did my last posts make sense to you? |
i've made some more progress on this lately. Have converted the base Reactabular source to TSX. It compiles and UI runs fine, but tests currently break. Will continue converting the remaining source and existing tests to TypeScript... |
The text was updated successfully, but these errors were encountered: