Skip to content

refactor: HMR and webpack improvements#7462

Merged
vakrilov merged 6 commits into
releasefrom
qualifiers-webpack
Jul 8, 2019
Merged

refactor: HMR and webpack improvements#7462
vakrilov merged 6 commits into
releasefrom
qualifiers-webpack

Conversation

@vakrilov

@vakrilov vakrilov commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

In this PR:

  • Changes in global.loadModule. Modules loaded from builder are loaded with global.loadModule(moduleName, true). This will make the global._isModuleLoadedForUI() function return true for this module. The webpack hot-loader inserts a check for each module and enables self-accept (module.hot.accept()) if this module was loaded form the builder. This means that all modules can be processed build-time by the hmr-loader but only those that were loaded (runtime) by the builder will be self-accepted and will trigger HMR logic.
  • HMR for custom-components: Whenever custom component code or markup is updated it will cause refresh of the page containing the custom-component.

@cla-bot cla-bot Bot added the cla: yes label Jul 4, 2019
@vakrilov vakrilov requested a review from vchimev July 4, 2019 12:53
@vakrilov vakrilov changed the title refactor: HMR and webpack imporvements refactor: HMR and webpack improvements Jul 4, 2019
@vakrilov vakrilov closed this Jul 4, 2019
@vakrilov vakrilov reopened this Jul 4, 2019
@vakrilov vakrilov marked this pull request as ready for review July 4, 2019 13:15
Comment thread tns-core-modules/ui/core/view/view-common.ts Outdated
@@ -35,7 +36,7 @@ export function convertString(value: any): any {
export function getModuleName(path: string): string {

@vchimev vchimev Jul 5, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like sanitizeModuleName() eliminates the need for getModuleName() - it is not used anymore and could be deleted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - it was released "officially" in 5.4 though - do you think it's OK to remove it?

Comment thread tns-core-modules/globals/register-module-helpers.ts Outdated
@vakrilov vakrilov force-pushed the qualifiers-webpack branch from f377963 to fa56ad7 Compare July 5, 2019 14:12
@vakrilov vakrilov merged commit 8756b3d into release Jul 8, 2019
@vakrilov vakrilov deleted the qualifiers-webpack branch July 8, 2019 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants