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

Feat/pick settings from multiplying architecture at init #1211

Conversation

apupier
Copy link
Member

@apupier apupier commented Jun 27, 2024

currently error in console.log:

react-dom.development.js:16227 Uncaught (in promise) Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at Object.throwInvalidHookError (react-dom.development.js:16227:1)
    at useContext (react.development.js:1618:1)
    at KaotoEditorApp.tsx:30:41

image

@apupier apupier force-pushed the feat/pickSettingsFromMultiplyingArchitectureAtInit branch from 671b29d to a5fc901 Compare June 27, 2024 15:24
@apupier
Copy link
Member Author

apupier commented Jun 27, 2024

now it can load the one specified in settings

To do:

  • in case the provided url is invalid, there is a blank page without details
  • handle not set value (either use an empty string or fix the framework??)
Error: Cannot read properties of null (reading 'setLoadingFinished')
	at __webpack_modules__../node_modules/@kie-tools-core/envelope-bus/dist/common/EnvelopeBusMessageManager.js.EnvelopeBusMessageManager.callback (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:2217:29)
	at __webpack_modules__../node_modules/@kie-tools-core/envelope-bus/dist/common/EnvelopeBusMessageManager.js.EnvelopeBusMessageManager.receive (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:2225:18)
	at Object.receive (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:2082:27)
	at __webpack_modules__../node_modules/@kie-tools-core/envelope-bus/dist/channel/EnvelopeServer.js.EnvelopeServer.receive (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:1939:33)
	at /home/apupier/git/vscode-kaoto/dist/extension/extension.js:3290:34
	at /home/apupier/git/vscode-kaoto/dist/extension/extension.js:3106:65
	at Array.forEach (<anonymous>)
	at EnvelopeBusMessageBroadcaster.broadcast (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:3106:28)
	at VsCodeKieEditorController.<anonymous> (/home/apupier/git/vscode-kaoto/dist/extension/extension.js:3292:129)

there is another error before on runtime.provider.tsx l.36:

 vscode-webview://0bejvs782c6acfhrtt3091l4amv76htnp2dnu70qrl1ft0pk535i/null/index.json net::ERR_ACCESS_DENIED

so means the props.catalogUrl at this place is not picking the one from the rootcomponent, or picking it before and i guess we are back to the need to use React context that i wasn't able to use .

@apupier
Copy link
Member Author

apupier commented Jun 28, 2024

@lordrip any hints what is the correct way to proceed so that the catalogUrl is set/updated in a correct way for React?

@lordrip
Copy link
Member

lordrip commented Jun 28, 2024

@lordrip any hints what is the correct way to proceed so that the catalogUrl is set/updated in a correct way for React?

After checking, I realized there's a missing provider in the KaotoBridge.tsx component, I'm adding it here: #1219

@apupier
Copy link
Member Author

apupier commented Jun 28, 2024

@lordrip any hints what is the correct way to proceed so that the catalogUrl is set/updated in a correct way for React?

After checking, I realized there's a missing provider in the KaotoBridge.tsx component, I'm adding it here: #1219

so potentially, rebasing should be enough?

@apupier apupier force-pushed the feat/pickSettingsFromMultiplyingArchitectureAtInit branch 6 times, most recently from 00d604f to 5bbfa6d Compare July 3, 2024 09:50
@apupier
Copy link
Member Author

apupier commented Jul 3, 2024

There is currently quite a mix between passing the catalogURL through properties on the React component and using the settingsManager. I failed to use just one or the other in a good way so far. Given current constraints on timeline and ressources, I propose to go with current state and work to improve that later. Reported #1227 for that.

@apupier
Copy link
Member Author

apupier commented Jul 3, 2024

In combination with #1227 , it gives:
catalogUrlInVSCode

@apupier apupier marked this pull request as ready for review July 3, 2024 10:12
@apupier apupier requested a review from a team July 3, 2024 11:36
Copy link
Member

@lordrip lordrip left a comment

Choose a reason for hiding this comment

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

I tested it restoring the runtime.provider.tsx file and it works good in both VSCode and the online version.

@apupier apupier force-pushed the feat/pickSettingsFromMultiplyingArchitectureAtInit branch from 5bbfa6d to 8a1ccfb Compare July 4, 2024 07:05
@apupier apupier force-pushed the feat/pickSettingsFromMultiplyingArchitectureAtInit branch from 8a1ccfb to 453d456 Compare July 4, 2024 07:17
@apupier apupier merged commit d9986e8 into KaotoIO:main Jul 4, 2024
9 checks passed
@apupier apupier deleted the feat/pickSettingsFromMultiplyingArchitectureAtInit branch July 4, 2024 13:48
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.

2 participants