[BUGFIX beta] Only register this observer in debug builds
Merge pull request #10005 from ebryn/dev-elementId-observer

Only register `View#elementId` observer in debug builds