-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Upgrade to webpack@5 #4725
Upgrade to webpack@5 #4725
Conversation
…ion -- part 1 Signed-off-by: Roman <[email protected]>
e1629d6
to
f4f937d
Compare
Shouldn't think be marked as a chore? |
whatever :) |
Signed-off-by: Roman <[email protected]>
- extending getTSLoader() to accept more options from ts-loader Signed-off-by: Roman <[email protected]>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Roman <[email protected]>
…tempt # Conflicts: # package.json # yarn.lock
Signed-off-by: Roman <[email protected]>
Conflicts have been resolved. A maintainer will review the pull request shortly. |
…g resources via webpack Signed-off-by: Roman <[email protected]>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…tempt # Conflicts: # src/common/catalog-entities/kubernetes-cluster.ts
…'s not bundled with HtmlWebpackPlugin() anyway anda all fonts loaded via css @font-face rule Signed-off-by: Roman <[email protected]>
…cripts change Signed-off-by: Roman <[email protected]>
…gin` to support HMR in most cases Signed-off-by: Roman <[email protected]>
@lensapp/lens-maintainers PTAL, ready for testing & reviews. HMR demo: Screen.Recording.2022-02-14.at.16.03.19.mov |
"ts-loader": "^8.0.4", | ||
"typescript": "^4.3.2", | ||
"webpack": "^4.46.0" | ||
"ts-loader": "latest", |
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 shouldn't use latest
here because it will break if there is a mismatch of versions between this file and ../../package.json
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 it will break when it's not used in "production" / inside packed extension?
I think only ts-loader
must be compatible with local webpack
package.
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 do run npm install
on extensions, even bundled extensions.
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.
When we do? So maybe we should move it to peerDependencies
then?
Anyway I think it should be handled from parent's package version, otherwise it's just copy-pasting all around. Can we use actual versions from app's package.json
on extensions install?
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 is where we do the install calls
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.
Well, it's still unclear how this installing dependency handle unpacking extension:
await this.dependencies.installExtension(extension.absolutePath);
In general it feels wrong if compiled extension require matching own development dependencies with the app (in case of react
, mobx
and some other packages we're sharing them via global env because version matching there is important for app's work. @jakolehm @nevalla @panuhorsmalahti wdyt?
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.
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.
Note: using latest
version might still be a bit risky (in general).
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 think it's not more risky than just having outdated specific version == in both cases I assume it's easy to spot/fix/use what is needed per extension package.
Signed-off-by: Roman <[email protected]>
…dev`) Signed-off-by: Roman <[email protected]>
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
"ts-loader": "^8.0.4", | ||
"typescript": "^4.3.2", | ||
"webpack": "^4.46.0" | ||
"ts-loader": "latest", |
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.
Note: using latest
version might still be a bit risky (in general).
@aleksfront that second issue is a known issue that exists on master. I don't think it should block this PR |
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.
Except for the font issue. This looks good to me.
fix is already done (gonna create new PR very soon) |
This reverts commit d656a9e.
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
This also fixing nasty caching bug with UI files after combination(s) of
make clean && make dev
/ page reload /git checkout
branches / etc.TODO:
main
process (types must be imported separately in files participating in extension-api re-exports)renderer
process@pmmmwh/react-refresh-webpack-plugin
withreact-refresh-typescript
to support HMR in most cases