-
Notifications
You must be signed in to change notification settings - Fork 1
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
ENGWORK-5595: Make MVC compatible with React 18 #18
base: main
Are you sure you want to change the base?
Conversation
joshwilsonvu
commented
Oct 22, 2024
- ENGWORK-5595: Updated core logic in ApplicationView to be React 18 compatible. Started making ApplicationController compatible.
…mpatible. Started making ApplicationController compatible.
// TODO: It might be easier to replace this with `tsdx`, which makes it easy to build both ESM and | ||
// CJS output with correct .d.ts files without worrying about externals. Using "exports" in | ||
// package.json helps tools find the right files they need. |
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.
tsdx is awesome, I'd be happy to adopt that
// Same thing, except for class components, though we don't seem to be wrapping any class | ||
// components in aha-app. Doesn't prevent tearing, since class components can't use | ||
// `useSyncExternalStore`. The original plan was to render the class component under a function | ||
// component similar to the above, only observing the class component's render method, but there's | ||
// no way to reference the render method from the function component before rendering is complete. | ||
// This is the best we can do. | ||
// TODO: Actually, maybe we can pass a ref from the parent function component to the child class | ||
// component and somehow use that to wire up the ViewStore with the class's `render()` method? Idk | ||
// if that's possible. |
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'm not sure if we need to support class components? The ones we have would date to pre-mvc I think, and if we were to adopt mvc we'd migrate them to function components.
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 agree—I just hate to do nothing and risk silent failures should we start wrapping class components. But maybe TS types that reject class components and documentation is enough.