Skip to content

Commit 09da76b

Browse files
authored
refactor(core): Add an app instance to activeApps before rendering (#482)
* refactor(core): Add an app instance to activeApps before rendering * workflow: modify pull request template
1 parent 9f394f7 commit 09da76b

File tree

9 files changed

+26
-17
lines changed

9 files changed

+26
-17
lines changed

.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ const NodeGlobals = ['module', 'require'];
33
module.exports = {
44
root: true,
55
parser: '@typescript-eslint/parser',
6-
ignorePatterns: ['**/dist', 'dev/', 'api-extractor.json', 'packages/*/dist'],
6+
ignorePatterns: [
7+
'**/dist',
8+
'dev/',
9+
'shimsVue.d.ts',
10+
'api-extractor.json',
11+
'packages/*/dist',
12+
],
713
parserOptions: {
814
sourceType: 'module',
915
},

.github/pull_request_template.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# PR Details
2-
3-
<!--- Provide a general summary of your changes in the Title above -->
4-
51
## Description
62

3+
<!--- Provide a general summary of your changes in the Title above -->
74
<!--- Describe your changes in detail -->
85

96
## Related Issue

dev/app-vue-2/src/shims-vue.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dev/app-vue-2/src/shimsVue.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable */
2+
declare module '*.vue' {
3+
/* eslint-disable */
4+
// eslint-disable-next-line
5+
import type Vue from 'vue';
6+
// eslint-disable-next-line
7+
export default Vue;
8+
}

dev/app-vue-3/src/shims-vue.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
declare module '*.vue' {
23
import type { DefineComponent } from 'vue';
34
const component: DefineComponent<{}, {}, any>;

dev/app-vue-vite/src/shimsVue.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-disable */
2+
declare module '*.vue' {
3+
import type { DefineComponent } from 'vue';
4+
const component: DefineComponent<{}, {}, any>;
5+
export default component;
6+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"prettier --write"
3131
],
3232
"*.ts?(x)": [
33-
"eslint --fix",
33+
"eslint --fix --config .eslintrc.js",
3434
"prettier --parser=typescript --write"
3535
]
3636
},

packages/core/src/module/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ export class App {
232232
return false;
233233
}
234234
this.hooks.lifecycle.beforeMount.emit(this.appInfo, this, true);
235+
this.context.activeApps.push(this);
235236

236237
await this.addContainer();
237-
this.context.activeApps.push(this);
238238
this.callRender(provider, false);
239239
this.display = true;
240240
this.hooks.lifecycle.afterMount.emit(this.appInfo, this, true);
@@ -266,6 +266,7 @@ export class App {
266266
this.active = true;
267267
this.mounting = true;
268268
try {
269+
this.context.activeApps.push(this);
269270
// add container and compile js with cjs
270271
const { asyncScripts } = await this.compileAndRenderContainer();
271272
if (!this.stopMountAndClearEffect()) return false;
@@ -275,7 +276,6 @@ export class App {
275276
// Existing asynchronous functions need to decide whether the application has been unloaded
276277
if (!this.stopMountAndClearEffect()) return false;
277278

278-
this.context.activeApps.push(this);
279279
this.callRender(provider, true);
280280
this.display = true;
281281
this.mounted = true;

0 commit comments

Comments
 (0)