ember-fastboot / ember-fastboot/ember-cli-fastboot

Rehydration: Bound HTML attributes aren't rehydrated correctly

Open
#594 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
850
Forks
161
Avg merge
17h 45m
Merged PRs (30d)
19

Description

attn @rondale-sc

There seems to be an issue when rehydrating certain HTML attributes. I created a repro here: https://github.com/paulcwatts/rehydration-bug

I have a controller defined like this:
```
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend({
fastboot: service(),

buttonDisabled: true,
buttonEnabled: false
});
```

Within the template, I have a few buttons that are bound to various properties:

```
Disabled
Enabled
Disabled in Fastboot
```

You can see the expected and actual values here: https://github.com/paulcwatts/rehydration-bug/blob/master/app/templates/application.hbs

Two things that are interesting to note:

It appears to fail only if the attribute *changes* between when Fastboot renders and when the rehydration code operates. For instance in the second case (where it remains enabled), the rehydrated DOM is the same (the bare `disabled` attribute).

Secondly, I noticed it seems to work correctly if you insert some invalid HTML5 in the template. For instance, if you add: `` before the buttons, it works fine. Could it be the case where invalid HTML5 causes the rehydration code to bail out?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.