Skip to content

CreateBase deprecates loading property in favor of authLoading #11243

Closed

Description

@fmarchalemisys

What you were expecting:

This instruction says loading is deprecated:

<Create loading={loading}>

The deprecation notice is found in CreateBase.

However, the loading property is more natural because it is used in other objects. authLoading suggests that the loading indicator is only displayed during the authentication phase, while loading is expected to be displayed all the time if authLoading is not set.

Besides, the loading property of EditBase is not deprecated.

I suspect the deprecation notice on CreateBase is a mistake.

Activity

  1. Will-thom commented on Apr 22, 2026

    @Will-thom
    Contributor

    Hi, fmarchalemisys.

    From what I understand, the issue is about the inconsistency between CreateBase and EditBase regarding the loading prop.

    In CreateBase, loading is already marked as deprecated in favor of authLoading, while in EditBase it is still present and actively used.

    This creates an inconsistent API surface across similar controller components (Create vs Edit), even though both are now driven by controller state (useCreateController / useEditController).

    It seems the original intention is to discourage external control of loading state in favor of controller-driven flags, except for authLoading which is a special case.

    Should the expected direction be:

    • remove loading entirely from both CreateBase and EditBase, or
    • keep it for backward compatibility but align behavior/deprecation across both?
  2. fmarchalemisys commented on Apr 22, 2026

    @fmarchalemisys
    Author

    Hi @Will-thom

    I expect to see the loading property next to authLoading or both to be deprecated in favor of a new mechanism.

    As a developer using the API, I don't understand why one should be treated differently than the other.

    It is confusing to see that authLoading is documented on the <Create> page but no loading property is documented. If none were documented, I would have started looking through the doc for a way of showing the loading indicator. When I saw authLoading in the doc, I dig into the source code and found the comment saying to use authLoading instead of loading. That makes no sense as they should serve different purposes.

  3. Will-thom commented on Apr 22, 2026

    @Will-thom
    Contributor

    Hi @fmarchalemisys

    Thanks for the clarification — I understand the concern around the semantic ambiguity between authLoading and loading.

    To avoid turning this into a larger redesign discussion, I’d like to propose a minimal alignment step:

    Option A (incremental, low risk):

    • Deprecate loading in EditBase (same as CreateBase)
    • Keep authLoading as-is
    • Improve documentation consistency

    Option B (slightly more forward-looking):

    • Deprecate loading in both CreateBase and EditBase
    • Clearly document that loading-related UI should rely on controller state or authLoading only

    This PR would implement Option A unless you prefer otherwise.

    If this direction sounds reasonable, I’ll proceed with a focused PR.

  4. fmarchalemisys commented on Apr 22, 2026

    @fmarchalemisys
    Author

    Hi @Will-thom

    Option A sounds good to me. At least, it won't look like loading was deprecated by mistake on CreateBase.

    Can you also update the deprecation comment to state that loading is replaced with the saving boolean returned by useCreateController?

  5. Will-thom commented on Apr 22, 2026

    @Will-thom
    Contributor

    Hi @fmarchalemisys

    Thanks for the guidance — this makes sense.

    Apologies for the delay, I’ve been a bit short on time, but I’m still planning to take care of this.

    I’ll proceed with the changes (deprecating loading in EditBase and updating the deprecation comments) and open a PR shortly.

  6. Will-thom commented on Apr 27, 2026

    @Will-thom
    Contributor

    Hi @fmarchalemisys

    I've implemented Option A and updated the deprecation comments to clarify that loading is replaced by the saving state from the controller, as suggested.

    PR Details:

    chore: deprecate loading prop in EditBase and clarify usage #11249

  7. fzaninotto commented on Apr 28, 2026

    @fzaninotto
    Member

    The origin of the deprecation lies in #10880.

    The idea is that we introduced a loading prop for when the data is loading, and renaned the old loading prop, which was the component displayed while the auth propvider is checked, to authLoading. To make the change backwards compatible, authLoading takes the loading value by default.

    But CreateBase is particular: there is no data to load. So it can't really have the same syntax as the other Base components as there is no data loading prop. To be consistent with the other components, we introduced authLoading on CreateBase and deprecated loading.

    So in my opinion there is no error in the code.

  8. fmarchalemisys commented on Apr 29, 2026

    @fmarchalemisys
    Author

    Thanks to your detailed explanation, @fzaninotto , I now understand why the code is as it is.

    In light of your explanation, the documentation of Create and EditBase now make sense.

    So, there are loading, authLoading, and saving properties. The confusion stems from the fact that saving is not grouped with the other two on the component. Is there any chance they could all be grouped under the controller flags?

    authLoading could also be renamed as authChecking. This is the wording used in the documentation. authChecking would decouple it from the "loading" vocable.

    As for the immediate issue, I think the confusion could be resolved by rewording the deprecation comment in CreateBase. Something along the line:

    @deprecated Renamed to authLoading because "loading" is used by EditBase for loading the data to edit
    
  9. fzaninotto commented on Apr 29, 2026

    @fzaninotto
    Member

    The confusion stems from the fact that saving is not grouped with the other two on the component. Is there any chance they could all be grouped under the controller flags?

    I don't understand this question. What group are you talking about?

    authLoading could also be renamed as authChecking. This is the wording used in the documentation. authChecking would decouple it from the "loading" vocable.

    This would be a breaking change so we won't move forward with this idea

    the confusion could be resolved by rewording the deprecation comment in CreateBase.

    Maybe, but IMO the alternative you propose brings more confusion. Why mention EditBase in the CreateBase component?

  10. fmarchalemisys commented on Apr 29, 2026

    @fmarchalemisys
    Author

    I don't understand this question. What group are you talking about?

    To answer that question, I need to summarize the discussion in this issue.

    I opened this issue because I had to work on some old code <Create loading={loading}>. The IDE indicated that loading was deprecated. I looked at the deprecation notice but I couldn't understand it. The same flag on EditBase isn't deprecated despite authLoading being present on both components. So, why replace loading with authLoading on CreateBase but not on EditBase?

    @Will-thom explained it as follows:

    It seems the original intention is to discourage external control of loading state in favor of controller-driven flags, except for authLoading which is a special case.

    You (@fzaninotto) explained what the loading flag does and why it is not the same as authLoading despite the deprecation notice saying otherwise.

    Both your explanations lead to my observation that some flags (saving, isFetching, isPending) are provided by useCreateController/useEditController whereas authLoading and loading are provided by <CreateBase>/<EditBase>. This discrepancy may be historical or technical, but it looks cumbersome and plays a good part in my misunderstanding of the purpose of the loading flag.

    At this point, I think this issue is merely a documentation and wording issue not worth pursuing unless others stumble on it too.

    Thanks for the clarification.

  11. fzaninotto commented on Apr 29, 2026

    @fzaninotto
    Member

    The separation between the controller and components is correct IMO:

    • saving, isFetching, and isPending are states independent of the UI
    • authLoading and loading are fallback component that depend on the UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions