Skip to content

Commit

Permalink
chore(framework): features loading (#9586)
Browse files Browse the repository at this point in the history
With this change race condition where feature is loaded while component is defining its dependencies and its handler for feature loading is not attached is handled.
  • Loading branch information
nnaydenow authored Jul 31, 2024
1 parent 20cc921 commit cf4eb7d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"chromedriver": "^125.0.0"
"chromedriver": "^126.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"devDependencies": {
"@openui5/sap.ui.core": "1.120.17",
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"chromedriver": "^125.0.0",
"chromedriver": "^126.0.0",
"clean-css": "^5.2.2",
"copy-and-watch": "^0.1.5",
"cross-env": "^7.0.3",
Expand Down
6 changes: 5 additions & 1 deletion packages/base/src/UI5Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import type {
} from "./types.js";
import { attachFormElementInternals, setFormValue } from "./features/InputElementsFormSupport.js";
import type { IFormInputElement } from "./features/InputElementsFormSupport.js";
import { subscribeForFeatureLoad } from "./FeaturesRegistry.js";
import { getComponentFeature, subscribeForFeatureLoad } from "./FeaturesRegistry.js";

const DEV_MODE = true;
let autoId = 0;
Expand Down Expand Up @@ -1220,6 +1220,10 @@ abstract class UI5Element extends HTMLElement {
const features = this.getMetadata().getFeatures();

features.forEach(feature => {
if (getComponentFeature(feature)) {
this.cacheUniqueDependencies();
}

subscribeForFeatureLoad(feature, this, this.cacheUniqueDependencies.bind(this));
});

Expand Down
2 changes: 1 addition & 1 deletion packages/compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"chromedriver": "^125.0.0"
"chromedriver": "^126.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/fiori/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"chromedriver": "^125.0.0"
"chromedriver": "^126.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@openui5/sap.ui.core": "1.120.17",
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"babel-plugin-amd-to-esm": "^2.0.3",
"chromedriver": "^125.0.0",
"chromedriver": "^126.0.0",
"estree-walk": "^2.2.0",
"mkdirp": "^1.0.4",
"resolve": "^1.20.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.1.0-rc.2",
"chromedriver": "^125.0.0"
"chromedriver": "^126.0.0"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6094,10 +6094,10 @@ chrome-trace-event@^1.0.2:
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==

chromedriver@^125.0.0:
version "125.0.0"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-125.0.0.tgz#1fed0351865bf45a3417cbdac45e2dc4257cb876"
integrity sha512-wWXrxWLWqXRTmRZDtPigs+ys44srlpHTpsL7MHnZc9iaE1oIB0hslSVeem6TcsEb1Ou8nvPx3vs5bPwCI6+VHg==
chromedriver@^126.0.0:
version "126.0.5"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-126.0.5.tgz#5db6f463c7557e3a76b7fe7fb73aaf2f06fd07e6"
integrity sha512-xXVxwxd8CJ6yg2KEvFqLQi7V0RvF78xFnLB+xo9g9MoJNHMQccD7b4OWaxtKDy5RXrMgQ6Jb6vUN3SjTYXHLEQ==
dependencies:
"@testim/chrome-version" "^1.1.4"
axios "^1.6.7"
Expand Down

0 comments on commit cf4eb7d

Please sign in to comment.