Code Monkey home page Code Monkey logo

Comments (3)

borisyordanov avatar borisyordanov commented on August 15, 2024 2

@aliemir Ideally there'd be a lint rule to protect you against duplicate names, but there don't seem to be any good options.

My advice is to adopt a naming convention for each of your packages. Add a prefix or suffix to distinguish between two similar, but separate entities. Example ButtonBase and Button.

When you have decided on a convention it can be enforced with https://typescript-eslint.io/rules/naming-convention/#prefix--suffix where each one of your packages will have the rule configured differently.

The end result would be that you can safely import:

// before
import { UseFormProps } from "@refinedev/core";
import { UseFormProps } from "@refinedev/react-hook-form";

// after
import { UseFormPropsCore } from "refinedev/core";
import { UseFormPropsHookForm } from "@refinedev/react-hook-form";

I hope you'll be able to come up with a more elegant solution, but this is the best option I can think of atm.

from refine.

aliemir avatar aliemir commented on August 15, 2024

Hey @borisyordanov, We have UseFormProps in both @refinedev/core and @refinedev/react-hook-form. Additionally, we have useForm in both as well. The latter is an extended version of the former. If you're going to extend the one from @refinedev/react-hook-form you'll need to use the UseFormProps from that package as well.

I think I understand the confusion here, we might need to rename them to be explicit 🤔 Do you have any suggestion how we can avoid confusion here? 🙏

from refine.

aliemir avatar aliemir commented on August 15, 2024

Hey @borisyordanov, thank you for the suggestion. We've discussed with the team and decided not to take any actions for now about the naming conventions. In the future, there may be changes related to how we export things and changes in the naming may cause issues with those.

Thank you for reporting, closing this issue for now. I'll update here and mention this issue when we have related changes planned/implemented. 🙏

from refine.

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.