You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The preferred usage since Next-Drupal 1.6 is to use the DrupalClient class.
The get* functions (like getRousource()) recommend in the 1.0 release are informally deprecated. (Though the use-menu hook still uses one of them internally.)
It makes sense to deprecate those functions since they require environment variables like NEXT_PUBLIC_DRUPAL_BASE_URL to configure the JSON:API endpoint. And that setup is inflexible as it's impossible to query two or more Drupal endpoints in one codebase.
Describe the solution you'd like
The get* functions should be formally deprecated. Any use of them should generate a console warning about a deprecated usage. And we should add a JSDoc comment with a @deprecated flag.
Package
next-drupal (NPM package)
Describe the feature request
The preferred usage since Next-Drupal 1.6 is to use the
DrupalClient
class.The
get*
functions (likegetRousource()
) recommend in the 1.0 release are informally deprecated. (Though theuse-menu
hook still uses one of them internally.)It makes sense to deprecate those functions since they require environment variables like
NEXT_PUBLIC_DRUPAL_BASE_URL
to configure the JSON:API endpoint. And that setup is inflexible as it's impossible to query two or more Drupal endpoints in one codebase.Describe the solution you'd like
The
get*
functions should be formally deprecated. Any use of them should generate a console warning about a deprecated usage. And we should add a JSDoc comment with a@deprecated
flag.That suggestion comes from a StackOverflow question about marking obsolete methods.
It's unclear if deprecating
useMenu()
should also be done, but it does use agetMenu()
internally.Describe alternatives you've considered
Just removing them in 2.x, but a little more warning would be nice.
The text was updated successfully, but these errors were encountered: