Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] When editing a story the app will always fully reload #219

Closed
dannyhw opened this issue Jul 13, 2021 · 3 comments
Closed

[6.0] When editing a story the app will always fully reload #219

dannyhw opened this issue Jul 13, 2021 · 3 comments
Labels
6.5 bug Something isn't working

Comments

@dannyhw
Copy link
Member

dannyhw commented Jul 13, 2021

Describe the bug

When editing a story fast reload is not working correctly.

This section of code was removed from the loadCsf file and might be related (line 251)

 if (m && m.hot && m.hot.dispose) {
      ({ previousExports = new Map() } = m.hot.data || {});
      m.hot.dispose((data) => {
        loaded = false;
        // eslint-disable-next-line no-param-reassign
        data.previousExports = previousExports;
      });
      m.hot.accept();
    }

The dispose part is not need however perhaps maintaining the hot.accept part would be useful... this needs some investigation probably.

 if (m && m.hot) {
      m.hot.accept();
  }
 

To Reproduce
Steps to reproduce the behavior:

  1. run example app
  2. edit a story file and save it or just save with no changes
  3. app fully reload

Expected behavior

Fast reload should be used such that only what changed gets reloaded.

@dannyhw dannyhw added bug Something isn't working 6.5 labels Jul 13, 2021
@dannyhw dannyhw added this to the v6 alpha 1 milestone Jul 13, 2021
@lauriharpf
Copy link
Contributor

I could take a stab at this! :)

lauriharpf added a commit to lauriharpf/react-native that referenced this issue Jul 13, 2021
…he app).

NOTE: At the moment, the app doesn't repaint when the hot reload occurs. Thus, this fix isn't usable as-is; we need to also figure out how to force the repaint so that the changes made in the hot reload are reflected.
lauriharpf added a commit to lauriharpf/react-native that referenced this issue Jul 14, 2021
…he fast reload so that the changes get immediately reflected without interaction with the UI.

FORCE_RE_RENDER is a stopgap solution: The UI doesn't seem to re-render even if React.memo is removed from OnDeviceUI.
@dannyhw dannyhw modified the milestones: v6 alpha 1, v6 alpha 2 Jul 15, 2021
@dannyhw
Copy link
Member Author

dannyhw commented Jul 15, 2021

I've moved this to alpha2 milestone. I think that we can go ahead without fast reload for now considering that the full reload now takes you back to the previous story. This seems like a difficult issue to solve so I'd rather not delay on the first alpha due to this.

@dannyhw
Copy link
Member Author

dannyhw commented Nov 5, 2022

fixed in #384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.5 bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants