Change record status: 
Project: 
Introduced in branch: 
10.1.x
Introduced in version: 
10.1.0-alpha1
Description: 

\Drupal\Core\Render\Element\Ajax will be removed from Drupal 9. Return an \Drupal\Core\Ajax\AjaxResponse instead.

Before

  $commands[] = new ReplaceCommand('#edit-date-format-suffix','<small id="edit-date-format-suffix">' . $format . '</small>');
  return ['#type' => 'ajax', '#commands' => $commands];

After

  $response = new AjaxResponse();
  $command = new ReplaceCommand('#edit-date-format-suffix','<small id="edit-date-format-suffix">' . $format . '</small>');
  $response->addCommand($command);
  return $response;
Impacts: 
Module developers