Giter VIP home page Giter VIP logo

Comments (5)

fzaninotto avatar fzaninotto commented on April 28, 2024 1

Here is the process I suggest:

  1. Turn on strickNullChecks in your checkout
  2. Try to compile the core
  3. Choose a part of the library (auth, forms, etc)
  4. Fix a reasonable amount of errors to make the change readable
  5. Turn off strickNullChecks
  6. Open a PR with your changes.

This way, we can gradually make the types better. It will take several PRs to fix the core. This improvement will only be made available for users once we have all the checks fixed. But that's the only safe way.

from react-admin.

fzaninotto avatar fzaninotto commented on April 28, 2024

Hi, and thanks for your report.

We're well aware of the limitations caused by structNullChecks=false in the quality of types. We have it on our radar, but the benefit / cost ratio of this task is low, so it's not a priority for us. Fixing it is non-trivial, as we have to make ra-core compilable with strict?NullChecks=true. Previous attempts (#8141) lead to a dead end.

You're welcome to contribute small PRs fixing types of individual hooks & components for strict null checks.

I'm closing this issue as it's a long-term goal.

from react-admin.

gauthierm avatar gauthierm commented on April 28, 2024

Thanks for letting us know it's a long term goal. It's not possible to fix the issue with the hooks until strictNullChecks is enabled. It's currently not possible to use the generated types safely in projects.

from react-admin.

gauthierm avatar gauthierm commented on April 28, 2024

@fzaninotto What sort of approach would be required to get strictNullChecks enabled? It looks like someone tried to help you with it in #8141, but because the scope of the change was too big the PR was closed.

I'm not sure how you could partially add strict null checks to make for a smaller PR that would be accepted.

The benefit is quite high for people using React Admin as it will catch a lot of runtime errors at compile time.

from react-admin.

fzaninotto avatar fzaninotto commented on April 28, 2024

Here is an exemple small PR fixing the ra-core types: #9644

from react-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.