GithubHelp home page GithubHelp logo

Comments (10)

ascorbic avatar ascorbic commented on May 18, 2024 4

I mean the warning. It warns when previously it didn't complain. I think this would count as a breaking change. It renders fine in both cases, so the warning isn't needed.

from react.

rickhanlonii avatar rickhanlonii commented on May 18, 2024 1

It doesn't count as a breaking change, since we don't consider DEV warnings as breaking changes in our development policy: https://react.dev/community/versioning-policy#what-counts-as-a-breaking-change

But we should probably make this a deprecation warning instead of the current text since it implies it doesn't work. Something like:

Warning In React 19,fetchpriority has been renamed to fetchPriority. We will remove support fetchpriority in a future version. Please check the render method of <Foo>.

What do you think @eps1lon?

from react.

ascorbic avatar ascorbic commented on May 18, 2024 1

I wish there was a way to feature-detect for it though. A warning is fine for end users, but those of us building libraries will need to support both. Granted, there probably aren't many libraries that need to set that particular prop (and with vercel/next.js#65235 and ascorbic/unpic-img#644 those are probably most covered), but checking for the existence of use isn't a great solution.

from react.

eps1lon avatar eps1lon commented on May 18, 2024

In the repro, the fetchpriority attribute is set for both cases. The warning targets different casings now. Is there some other behavior that changed?

from react.

ascorbic avatar ascorbic commented on May 18, 2024

Both should work correctly, with no warnings. fetchpriority works in 18.2.0. Adding support for fetchPriority shouldn't have broken the previously-supported casing, but seems to have done so.

from react.

eps1lon avatar eps1lon commented on May 18, 2024

With broken you mean the warning that changed or is there some other, end-user observable behavior that broke?

from react.

ascorbic avatar ascorbic commented on May 18, 2024

Are you planning to remove support? I'm not clear on the policy there: is the plan to only support DOM properties and not HTML attributes?

from react.

eps1lon avatar eps1lon commented on May 18, 2024

Mabye the "invalid" wording is a bit strong. We should just say it's renamed as @rickhanlonii suggests. But removing support would be a novel thing to do. We haven't done that for any other prop.

from react.

ascorbic avatar ascorbic commented on May 18, 2024

Is there any reason to not treat them as extra variants that are both supported (like Preact does), and not warn about either? One is the HTML attribute and the other is the DOM property and they both work.

from react.

eps1lon avatar eps1lon commented on May 18, 2024

It can get confusing with regards to object spreading and handling both casings. We'd have to add additional runtime logic to reconcile all casing variants.

Typechecking would also have to support both casings and would no longer flag if you specify both properties.

from react.

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.