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

Add hint to core functionality called early #1130

Merged
merged 9 commits into from
Mar 18, 2020

Conversation

ndricimrr
Copy link
Contributor

@ndricimrr ndricimrr commented Mar 5, 2020

Description
Certain Luigi functionality ( ex: auth() ) requires Luigi to be initialised, yet setConfig() might take some time causing such functionality to be called too early.

Changes proposed in this pull request:

  • Adds console warning when Luigi functionality gets called before the Luigi configuration is initialized.

In order to simulate the behaviour:

Add the following line :
Luigi.auth().store.getAuthData()

into luigi-sample-angular/src/luigi-config/extended/main.js right after setConfig() is called.

Then wrap the setConfig call with the timeout fn:
setTimeout( ()=>{ setConfig(...); }, 0);
in order to force setConfig() to lose the race. This is then going to produce a console warning

Related issue(s)

@ndricimrr ndricimrr changed the title Add hint to core called early Add hint to core functionality called early Mar 5, 2020
@ndricimrr ndricimrr added this to the Sprint 9 milestone Mar 5, 2020
@maxmarkus maxmarkus self-assigned this Mar 5, 2020
@maxmarkus maxmarkus added the WIP Work in progress label Mar 6, 2020
Copy link
Contributor

@JohannesDoberer JohannesDoberer left a comment

Choose a reason for hiding this comment

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

LGTM 👍 !

@JohannesDoberer JohannesDoberer self-assigned this Mar 10, 2020
@maxmarkus maxmarkus removed the WIP Work in progress label Mar 11, 2020
@JohannesDoberer JohannesDoberer merged commit 6f85adf into SAP:master Mar 18, 2020
JohannesDoberer added a commit to JohannesDoberer/luigi that referenced this pull request Mar 19, 2020
* master:
  Add hint to core functionality called early (SAP#1130)
JohannesDoberer added a commit that referenced this pull request Mar 25, 2020
* master: (37 commits)
  Update deps to 0.7.7 (#1193)
  Document potential wrong-usage of context/dynamic nodes (#1155)
  travis fix
  version upate to v0.7.7 (#1186)
  Revert fallbackFrame okResponseHandler  (#1183)
  fix virtualTree to not add trailing slash at viewUrl (#1172)
  Fix navigate ok check (#1179)
  remove docsearch (#1178)
  Recalculation after cache deletion (#1173)
  Luigi Videos (#1060)
  Add hint to core functionality called early (#1130)
  Add implementations/scenarios (#1116)
  deleteCache was missing in contextswitcher (#1148)
  Update type descriptions (#1131)
  Route change loses context in contextswitcher (#1145)
  Debug cypress travis - parallel e2e tests (#1121)
  trying to run npm step only if triggered or pushed to master (#1139)
  Release v0.7.6 revert docs fiddle (#1138)
  travis fix
  travis fix
  ...

# Conflicts:
#	.travis.yml
#	CHANGELOG.md
#	client/luigi-client.d.ts
#	client/package-lock.json
#	client/package.json
#	client/public/package.json
#	client/src/linkManager.js
#	core/examples/luigi-sample-angular/src/assets/sampleexternal.html
#	core/package-lock.json
#	core/package.json
#	core/public/package.json
#	core/src/core-api/_internalLinkManager.js
#	core/src/core-api/baseClass.js
#	core/src/main.js
#	core/src/navigation/TopNav.html
#	docs/application-setup.md
#	docs/getting-started.md
#	docs/luigi-client-api.md
#	lerna.json
#	plugins/auth/src/auth-oidc/index.js
#	scripts/setup/angular.sh
#	scripts/setup/no-framework.sh
#	scripts/setup/openui5.sh
#	scripts/setup/vue.sh
#	test/e2e-test-application/e2e/tests/1-angular/navigation.spec.js
#	test/e2e-test-application/package-lock.json
#	test/e2e-test-application/package.json
#	test/e2e-test-application/src/app/project/dynamic/dynamic.component.ts
#	test/e2e-test-application/src/luigi-config/extended/auth.js
#	website/docs/package-lock.json
#	website/docs/package.json
#	website/fiddle/package.json
JohannesDoberer added a commit to JohannesDoberer/luigi that referenced this pull request Apr 14, 2020
* master:
  Release v1 (SAP#1201)
  Update deps to 0.7.7 (SAP#1193)
  Document potential wrong-usage of context/dynamic nodes (SAP#1155)
  travis fix
  version upate to v0.7.7 (SAP#1186)
  Revert fallbackFrame okResponseHandler  (SAP#1183)
  fix virtualTree to not add trailing slash at viewUrl (SAP#1172)
  Fix navigate ok check (SAP#1179)
  remove docsearch (SAP#1178)
  Recalculation after cache deletion (SAP#1173)
  Luigi Videos (SAP#1060)
  Add hint to core functionality called early (SAP#1130)
  Add implementations/scenarios (SAP#1116)
  deleteCache was missing in contextswitcher (SAP#1148)
  Update type descriptions (SAP#1131)
  Route change loses context in contextswitcher (SAP#1145)
  Debug cypress travis - parallel e2e tests (SAP#1121)
@ndricimrr ndricimrr deleted the add-hint-to-core-called-early branch September 8, 2020 13:58
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants