-
Notifications
You must be signed in to change notification settings - Fork 0
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
Migration to Vite #61
Conversation
7b85a9b
to
90d8d53
Compare
To Do After Migration to Vite
|
452097a
to
b7998f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i assume everything is working fine now in SPipes editor, so after
comments are resolved we can merge .
421064a
to
5129fd7
Compare
@blcham I discovered that setState() is an asynchronous function but does not return a promise, making its behavior somewhat unpredictable. The only way to ensure state updates are processed before taking action is to use a callback function as the second parameter of setState(). Unfortunately, you cannot await setState() directly. The problem was that setState() was called multiple times within processGraph() and addNodes(), leading to an empty state. Additionally, this.renderCytoscapeElement() should be called after processGraph() has updated the nodes and edges state. However, since setState() is asynchronous, it didn't update the state in time, resulting in renderCytoscapeElement() receiving empty nodes and edges arrays. This is why the pipeline wasn’t rendered as shown in the picture I sent earlier. Rest.getScript(this.state.file, this.state.transformation).then((response) => {
this._processGraph(response);
this.renderCytoscapeElement();
}); |
I am completely stuck with this ticket. Yesterday, after fixing a bug that I described earlier, I attempted to test it in Docker (production mode). When I tried to load the scripts, the page wouldn't load due to a polyfill issue with process. The external library undici uses Node.js libraries that are not supported by the browser, which is causing this error: I attempted to use the vite-plugin-node-polyfills library, but it did not resolve the issue and instead introduced new problems, such as memory leaks during the build and strange conflicts:
I don't know how to resolve this, as there is limited information available, and nothing seems to work. I find out that using vite.js gives a different result between dev and build environment, that is why it works totally fine in a dev mode. I tried to define process myself with import Process from "process";
globalThis.process = Process; But It is also undefined in production: |
|
@palagdan to summarize our meeting:
Alternative solutions:
ad i):
|
5129fd7
to
e630cbb
Compare
I’ve fixed the bug, and it now works correctly in production mode as well. It’s ready for merging. |
5e9f8ad
to
58c58d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -58,10 +57,6 @@ const rankDirOptions = [ | |||
{ text: "TopBottom", key: "TB", value: "TB" }, | |||
]; | |||
|
|||
const websocketURL = new URL("/rest/notifications", window.location.href); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come we removed websockets? Do we still support the automatic detection of changes within scritps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested it and this does not work; please make a new issue for that.
To reproduce:
- open a script
- modify the script using a textual editor outside of SPipes editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}); | ||
}); | ||
} | ||
|
||
//prevent session timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we do not need this anymore?
@@ -96,16 +95,6 @@ class ScriptOntologyModal extends React.Component { | |||
</td> | |||
<td>{data[MODULE_EXECUTION_DURATION]}ms</td> | |||
{/*<td><Moment unix format="DD.MM.YYYY">{data[MODULE_EXECUTION_START_DATE]/1000}</Moment></td>*/} | |||
<td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still show execution start and finish date?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, execution is not working which you know i assume as we targeted it in #62 (not described there in detail so not sure)
Resolves #51
Resolves #58