-
Notifications
You must be signed in to change notification settings - Fork 14
Upgrade to @hawtio/react 1.10.1 #110
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
Conversation
| "@hawtio/react": "^1.10.1", | ||
| "@monaco-editor/react": "^4.6.0", | ||
| "@patternfly/react-charts": "^7.4.9", | ||
| "@patternfly/react-code-editor": "^5.4.18", | ||
| "@patternfly/react-core": "^5.4.14", | ||
| "@patternfly/react-icons": "^5.4.2", | ||
| "@patternfly/react-styles": "^5.4.1", | ||
| "@patternfly/react-table": "^5.4.16", | ||
| "@patternfly/react-tokens": "^5.4.1", | ||
| "@patternfly/react-topology": "^5.4.1", | ||
| "artemis-console-plugin": "workspace:*", |
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.
Isn't this against what is written in https://github.com/hawtio/hawtio-next/tree/main/app#dependencies-dev-dependencies-peer-dependencies, i.e. "... app should declare a dependency only if it is used directly in its code"?
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 app is using very little, but it uses @hawtio/react and artemis-console-plugin which use peer dependencies. So the app has to satisfy these peer requirements.
I'm not claiming my guide from Hawtio is written in stone ;) I probably need to revisit it from time to time.
| "webpack": "^5.99.0", | ||
| "webpack-cli": "^5.1.4", | ||
| "webpack-manifest-plugin": "^5.0.0" | ||
| "webpack": "^5.101.0" |
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.
Unless I'm missing something, webpack is only used by the app, so should not be needed here.
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 webpack issue here is special and tricky. @hawtio/react is using @module-federation/utilities, which has unnecessary (IMO) peer dependency on webpack.
At top level I have fixed it in .yarnrc.yml:
# this one is strange:
# - there's peer dependency to webpack, but I don't think it's necessary
# - suggested @module-federation/runtime doesn't refer to variables like __webpack_require__, so it doesn't look
# like direct replacement of @module-federation/utilities
'@module-federation/utilities@*':
peerDependenciesMeta:
'webpack':
'optional': trueThere 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.
But webpack version is specified as a devDependency in both the package and the app - isn't it enough to specify it as a peerDependency in package, and only specify devDependency in app?
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 followed the rule that if something is a peer dependency it probably should also be a dev dependency (so yarn install installs it, because it may be needed).
- in package:
webpackis a dev dependency because it's peer dependency (for@module-federation/utilitiesto propagate its peer dependency onwebpack- even if it's made optional in.yarnrc.yml) - in app:
webpackis a dev dependency because it's used as a bundler.
I know it may be confusing, it is for me, it's not what I'd expect, but I'm still learning ;)
|
Tested dev and prod build (yarn start and mvn run jetty) ... I have errors on both. I did delete node modules and ran yarn install again. @grgrzybek do you have any ideas? If not I can try to track it down to a particular commit if i'll have the time. |
|
@GChuf for shared module federation config from new ModuleFederationPlugin({
shared: {
'react': {
singleton: true,
requiredVersion: dependencies['react'],
},
'react-dom': {
singleton: true,
requiredVersion: dependencies['react-dom'],
},
'react-router-dom': {
singleton: true,
requiredVersion: dependencies['react-router-dom'],
},
'@hawtio/react': {
singleton: true,
requiredVersion: dependencies['@hawtio/react'],
},
'monaco-editor': {
singleton: true,
requiredVersion: dependencies['monaco-editor'],
},
'@patternfly/react-core': {
singleton: true,
requiredVersion: dependencies['@patternfly/react-core'],
},
}
}),the generated code (with switch(name) {
case "default": {
register("@hawtio/react", "1.10.1", () => (Promise.all([__webpack_r ...
register("@patternfly/react-core", "5.4.14", () => (Promise.all([__ ...
register("monaco-editor", "0.52.2", () => (Promise.all([__webpack_r ...
register("react-dom", "18.3.1", () => (Promise.all([__webpack_requi ...
register("react-router-dom", "6.30.1", () => (Promise.all([__webpac ...
register("react", "18.3.1", () => (__webpack_require__.e("vendors-n ...
}
break;
}the production chunk (in my case y = {
16828: () => g("default", "react", !1, [ 1, 18, 3, 1 ], () => j.e(644).then(() => () => j(63696))),
89144: () => g("default", "react-dom", !1, [ 1, 18, 3, 1 ], () => Promise.all([ j.e(644), j.e(695) ]).then(() => () => j(78325))),
1728: () => g("default", "monaco-editor", !1, [ 2, 0, 52, 2 ], () => Promise.all([ j.e(502), j.e(859) ]).then(() => () => j(11918))),
40266: () => g("default", "@patternfly/react-core", !1, [ 1, 5, 4, 14 ], () => Promise.all([ j.e(176), j.e(612), j.e(806), j.e(695) ]).then(() => () => j(73196))),
66418: () => g("default", "react-router-dom", !1, [ 1, 6, 30, 1 ], () => Promise.all([ j.e(644), j.e(695) ]).then(() => () => j(49348))),
4201: () => g("default", "@hawtio/react", !1, [ 1, 1, 10, 1 ], () => Promise.all([ j.e(176), j.e(612), j.e(806), j.e(631), j.e(695), j.e(680) ]).then(() => () => j(20596)))
},where What you see ( Let me check with |
|
I can confirm jetty:run also works. I think the issues im seeing are only there on development builds. Development builds only has the following errors: before "connecting", so right after inputting the URL into browser: After clicking connect and before logging in: I was now able to reproduce this scenario 4 times. |
|
The uncaught promise issue was supposed to be fixed with grgrzybek@b139a3a ... let's move to desperate stage - did you check with private mode? |
I think you were right ... I started another instance on port 8081 and opened chrome's incognito mode - no errors. Testing frontends is a nightmare. |
|
I've tested 6 browsers and all gave me the same result, I don't think the website was cached on all of them, but who knows ... In any case I've been thinking of trying to develop a CICD for the console and host it somewhere. It should make developing/testing easier. It's obviously impossible to make it for every developer's branch, but we could make the cicd for main, and maybe for another "development" branch here on this repository. |
|
I was never good at setting up CI/CD... But good idea! |
|
I cant get it to build, i get: [INFO] --- frontend:1.15.1:corepack (yarn build) @ artemis-console-extension --- |
|
@andytaylor did you try deleting all node_modules folders before installing packages again? |
|
@GChuf thanks, that did the trick, I forgot there are now multiple node_modules, I will review and merge |
|
I have run thru and tested these changes and all look good, It is a big PR so if anything needs addressing we should raise a jira and fix separately. I will check the licenses and update in a new PR if needed |
|
actually, @grgrzybek could you fix up the conflicts please |
I ensured that there should be only one top-level |
|
The reason this is saying it cant be rebased and merged due to conflicts seems to be due to the merge commit in the middle with the changes from #109, which were not linear with the other changes in the branch for this PR, and so the two streams of changes conflict with each other if trying to rebase the commits together. I think it would be nice to get rid of those seeming 'work in progress' commits without Jira refs to also get rid of the non-linearity, and so also fix the 'has conflicts' problem with this PR, by combining the changes from 109 into 1 commit and fixing up the other commits accordingly (or reworking the individual commits, including adding a Jira reference, if keeping them separate is actually desirable). |
… 1.10.0 * packages which should be MF-shared or specified at app level are moved to peerDependencies * jest tests are moved to jest-fetch-mock
|
Just adding my experience - I was able to merge grgrzybek:ggrzybek-console-fixes into main without any problems/conflicts through git cli interface. Github also seems to allow me to merge that branch into main in my own cloned repo through GUI interface, but not here in the official repo - by that I mean that official repo says there are conflicts and that the PR cannot be merged cleanly (I didn't dig deeper). Is merging via CLI and pushing to main an option, or does it have to be done through github's merge PR process? |
… Only the needed ones
…e.js version to fix the build
|
Yes so was I before commenting. The repo is set up for rebase-and-merge which is likely the difference between here and your fork, and certainly the difference from a local merge. Personally I think the commits are a bit of mess the way they are currently, especially those without references, and I would update them as I said. The changes could be pushed manually as they are if someone wants to. |
0e5d1d6 to
ee78d44
Compare
|
I see - I didn't know about rebase-and-merge setting, thanks for explaining. |
|
Just for future reference. An amazing write up on commit squash/rebase/merge best practices is on GitHub https://github.blog/developer-skills/github/write-better-commits-build-better-projects/ , In this case I would have squashed my commits into 1 or 2, as there is no reason to keep all (my) development mistakes in final history. Anyway, I'm glad this is merged now. Kudos to everyone involved! |
|
Thanks for the article @ViliusS ! This PR was quite disruptive so I wanted to record my mistakes ;) And btw, I'd love to get a T-Shirt with "I resolved yarn.lock conflicts and survived". |
|
It might be a bit messy but I'm really glad that this is finally merged, and that no casualties were reported due to yarn.lock files :) |
|
btw, I've just found the words to explain my behavior:
|
I completely understand what you mean. I've bean working on various FoxPro and PHP code bases reaching 1996 myself :) That's why the article clearly implies that tabs->spaces and refractoring commits should go into separate commits. Then you can ignore those commits with |




I know this PR is big. Not only it merges with #109 from @ViliusS, but fixes several things at once...
I wasn't able to send a PR for each separate JIRA and issue I worked on. The reason is that some changes needed to be added together.
Here's a list of fixed issues:
@hawtio/react1.10.1@patternfly/react-icons(to shrink bundle size)