-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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(core): Lazy-load nodes and credentials to reduce baseline memory usage #4577
Conversation
1f9c7ed
to
4e78c04
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.
- This breaks the dev flow for node builders in the team and in the community, because
watch
transpiles changes to dist but does not reflect them in the root dir cache. We have to keep the cache fresh or bypass it forwatch
. - In
/dist/known/credentials.json
the mapping from credential type name toclassName
andsourcePath
looks inferrable. Do we need these two details to load a credential type? In/dist/known/nodes.json
, the mapping from node type name toclassName
looks inferrable butsourcePath
becomes unpredictable because of grouping dirs likeAws
, which btw I am not sure we benefit much from.
this.types.nodes = this.types.nodes.concat(types.nodes); | ||
this.types.credentials = this.types.credentials.concat(types.credentials); | ||
|
||
// Copy over all icons and set `iconUrl` for the frontend |
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.
We are copying icons from /nodes-base/src
to /nodes-base/dist
with Gulp during build, and here we are copying those icons from /nodes-base/dist
to the root dir cache. Can we copy to both destinations in the same step, either with Gulp or otherwise?
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.
the first part happens during the build process for nodes-base
, and the second one happens when loading nodes-base
and community nodes that might also have icons.
We need the first step in the build, because we don't publish the icons in the src
folder, and we need these icons in the published package.
06ad335
to
62dd52c
Compare
Done. for now, we'll be using
In |
…ommunity packages can also use these
…g a webhook fails
624e772
to
7a11da3
Compare
Got released with |
over 50% drop in baseline memory usage, by loading nodes and credentials as they are needed, instead of loading them all at startup.