Description
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 (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.
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 a getMenu()
internally.
Describe alternatives you've considered
Just removing them in 2.x, but a little more warning would be nice.