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: switch to adapter-react-v5 #1096

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stevenengland
Copy link

PR Checklist:

  • Provide a meaningful description to this PR or mention which issues this fixes.
  • Ensure the project builds with npm run build
  • Add tests for your change. This includes negative tests (i.e. inputs that need to fail) as well as baseline tests (i.e. how should the directory structure look like?).
  • Run the test suite with npm test
  • If there are baseline changes, review them and make a separate commit for them with the comment "accept baselines" if they are desired changes
  • If you added a required option, also add it to the template creation (.github/create_templates.ts)
  • Add a detailed migration description to docs/updates explaining what the user needs to do when manually updating an existing project
  • Add your changes to CHANGELOG.md (referencing the migration description and this PR or the issue you fixed)

Description:
This PR solves the issue #1095 by switching from adapter-react to adapter-react-v5.

@stevenengland
Copy link
Author

I implemented that PR

I also created new adapters using the code base from this PR for TypeScript and for JavaScript as well. Both succeed. The newly created adapters then build fine. I was also able to start a dev-server instance for the newly created adapters. And now there comes the BUT.

In my dev environments, when I open the settings page of the adapter or the tab of the adapter, the content needs minutes to load. But then it loads the correct content and styled content. No errors in the console (except websocket reconnects) but one warning that made me curious. Here is a usual log containing this one. There it says:

"It looks like there are several instances of @mui/styles initialized in this application.
This may cause theme propagation issues, broken class names, specificity issues, and makes your application bigger without a good reason."

Maybe this is the reason, why the loading process takes that long? I have no idea so far how to determine where those 2 instances are originating from. I must admit that I was am not a React user until now in combination with ioB.

grafik

Could anybody use this PR code to create a new adapter and check if the loading times in a dev-server instance are also as huge as in my dev-server instance?

@Apollon77 Apollon77 requested a review from AlCalzone February 23, 2024 08:34
@stevenengland
Copy link
Author

Update: I recently recognized that the warnings and the slow loading only appear if the dev-server that is used for testing spins up a browser sync for HTML configuration. If it is set to jsonConfig there is no problem at all...

@AlCalzone
Copy link
Collaborator

I've had the issues with slow loading before. Seems to be some kind of incompatibility with the websocket proxy in dev-server and the self-written websocket server in iobroker that don't play along well.

I'll try to look at the PR soon. My time is pretty limited right now. Thanks for your work!

@stevenengland
Copy link
Author

Before merging I guess this one should be closed beforehand: ioBroker/dev-server#475
BrowserSync from the dev-server in combination with adapter-react-v5 causes this loading issues.

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