Bidirectional entity relationships? I am doing a migration right now and have a need to maintain how entities are related in a way that the core entity reference field does not seem to support.

Lets say I have two content types, Foo and Bar. I am migrating Foo first, and Bar gets stubbed.

I need to relate Foo to Bar, but the relationship is not one way. Bar is also related to Foo, but there is no way (when editing Bar) to see this relationship. If Foo or Bar are deleted, it needs to unlink that.

Does Drupal 8 do that yet? How would you effectively do this? Do you need to create a custom entity to hold links?

I looked at the Dynamic Entity Reference module and it does not seem to do this. I also looked at the Corresponding Entity Reference module and it looks dead with a lot of logged bugs (last release 2017).
I would use 2 entity reference field, one in each content type referencing the other. With some custom logic, you could add the desired behavior, eg remove reference Foo -> Bar when the user removes Bar -> Foo.

Regarding the migation, you can run the first migration twice with the --update flag the 2nd time:


Step 1. Migrate Foo. The migration_lookup plugin will not find any values for the entity reference so it will be empty.  
Step 2. Migrate Bar. Foo already exists, you should have no problem with the entity reference.
Step 3. Migrate Foo again, with the --update flag. Bar already exists, so the entity reference field will filled.