-
Notifications
You must be signed in to change notification settings - Fork 393
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
Support for React 17.x #993
Comments
yes v5 will fully support it, I'd also take a PR to add final bit of support to v4 |
How stable is v5 already? It's already time to update the TS definitions? |
What about 'react-widgets-moment'? It's not compatible with react widgets v5. |
v5 is almost ready to go, there are a few rough edges that need to be filed down and some more stuff to tweak. The issue is more that i'm still trashing a bit on the list and listbox implementations around focus management. In any case we use v5 in prod so it does work. The localizers need to be released as well |
O and v5 is in typescript so no new defs needed |
Ok... many files are still .js files, that's why. https://github.com/jquense/react-widgets/tree/v5/packages/react-widgets/src This makes it hard to use the library from a TS project. |
I've not completed migrating everything yet, yes. Happy to take some PR's if you want to help with that! I don't know that |
If you use This behavior simplified the initial experience of developers, but contributes to never have a clear understating of the already complicated ES modules system. Typescript goes the strict way, making a clear distinction between importing the whole modules, or importing the default export. Nowadays you can opt-in in typescript and you can opt-out in Babel. But by using this feature in the d.ts files your forcing consumes of “react-widgets” to opt-in, changing the typescript default. I think not using this feature is more correct because then consumes can still make the choice themselves. |
About contributing, if I have time I would try to convert the missing files to typescript and fix the imports. Could this be accepted? |
I happily accept PRs! And i'm fine with either import style practically, tho I am going to get mildly pedantic about this CJS thing. First there isn't really any spec for interop between CJS and ESM. The best we can do is look at how Node is handling it because it's the only actual environment that has to support CJS and esm. And at the moment, when importing from a commonJs module there are no named exports. E.g. importing CJS from ESM only allows importing as a default. None of that is important since this isn't about node interop, but still it's a interesting topic |
Not sure I understood the CJS / ESM argument in Node.js. You have any link? Anyway, I've started the typification... its a big undertaking and not easily divisible. I have removed the I would like to clarify what things are making friction before is too late.
I would like to hear your opinion on this issues to know what is important to you. I have made a very initial commit (maybe like the first 10%...) here: https://github.com/olmobrutall/react-widgets/commits/v5 If you want an example of the type of code that I tend to write, here are some examples: I will also may need a review/help clarifying types that are not clear from the usage. |
Awesome thanks for starting on this. I would probably not start with trying to get noImplictAny to pass as a measure for success. At least not initially, since it's going to spiral out of control quickly. If I might suggest an approach it would be to start with leaf files and let's convert them one at a time merge and move to the next? After everything is in TS then it'd be a good time to turn on the stricter settings and work through the new errors. It may be too much to tackle the main widget files, they do likely involve some API reworking and it may be easiest if I handle those since I've the most familiarity with the code. And yeah some things aren't super easy to type as is. I don't have super clear advice there, I'd like to be pragmatic about it. Somethings would benefit from type safety, some less so. Like the custom prop types, probably best to do an explicit any and not worry to much about it. In general, it's good to have user faces apis have types, less important (initially) for internal ones since an As far as code style goes, do whatever makes you happy, I run everything through Prettier ultimately so I'm not that picky |
Pull request made: #996 Hope it makes the TS story more complete. |
@mateusz-meller Worth mentioning that I am seeing these same warnings on React 16.12.0, released Nov 2019. Would love to see a v4 improvement on that for those who can't upgrade to v5 right away. |
I see that #996 has been merged. Where does v5 stand atm? Should I be trying to use that now? |
We are using it in production so v5 is fairly stable, but still a bit rough. The docs are the major remaining factor, baring any breaking change to fix something that doesn't pan out. At the moment tho it's looking good |
Having not followed any of the v5 work, is there a summary of the changes over v4 anywhere (beyond fixing lifecycle warnings and doing some apparent TS conversion) ? |
unfortunately no, nothing beyond the commit history at the moment. Major changes:
|
Facing the same issue. Using version 4.5.0 |
@jquense what's the current status of this issue?? |
It looks like there's only been 1 commit to the v5 branch since Sept. Is there a status update on this? An estimate on remaining work? |
that status is that i am quite busy with life and work, and don't have a ton of time to devote to this. v5 is fairly stable we use it in production. I believe that it's mostly just docs left, and the current doc setup is annoyingly bespoke, and prone to breakage which makes it tough to work on :P |
Totally understandable. Thank you for the update. |
@jquense any chance to publish my PR? It’s 18 days already... I don’t need docs, test or anything, just a version that compiles on typescript. Thanks |
yes sorry! forgot |
# Conflicts: # Signum.React/Scripts/Signum.Entities.ts
I'm getting the following warnings in my project:
Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: Uncontrolled(DateTimePicker)
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: Uncontrolled(DateTimePicker)
Is there any plan to support React 17.X in the near future?
The text was updated successfully, but these errors were encountered: