I opened this issue because as Alan and realityloop already know I've
been selected in the Google Summer of Code 2014 with the project 'Porting
the Diff module to Drupal 8'. One of the first steps we (me and my mentor,
Aron Novak) decided that needs to be done is to define the API for Drupal 8
version of Diff module.
I've started to study the implementation of 7.x-3.x-dev and considering the
changes in Drupal 8 we need to define the API for Drupal 8 version of diff
module. Some of the big changes in Field API concerning Diff module are
Properties in Drupal 7: NID, Title, etc. are now called "base fields"
and are defined in code by the modules defining the entity.
$fields['langcode'] = FieldDefinition::create('language')
->setDescription(t('The node language code.'))
What used to be called "fields" in Drupal 7 are now "configurable fields"
Do we need to provide to the modules defining the entity the possibility
of adding some other data to the comparison (other than fields) ? or
it is enough now to compare the fields of the entities meaning we don't
need hook_entity_diff anymore since the field comparison is handled by
the diff module only (how this fields are compared is also defined by
the diff module on behalf of the module which defined the field).
If we don't need hook_entity_diff anymore we could get rid of
hook_entity_diff_options() also since we don't need it anymore
(properties are now fields and thus handled by the diff module) and also
all those functions from includes/node.inc and includes/user.inc will be
transformed into MODULE_field_diff_view, MODULE_field_diff_view_prepare, etc.
Considering the above I would kindly ask those of you who know the current
architecture of Diff module and have some knowledge about Drupal 8 to say
if the architecture of the Drupal 8 version of diff can be simplified this way
and also if there are some other architectural changes to be taken into
consideration when defining the API for Drupal 8 version of Diff.
I would really appreciate some advice.
Sandbox link: https://drupal.org/sandbox/lhangea/2269693