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

ENGWORK-5595: Make MVC compatible with React 18 #18

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshwilsonvu
Copy link

  • ENGWORK-5595: Updated core logic in ApplicationView to be React 18 compatible. Started making ApplicationController compatible.

…mpatible. Started making ApplicationController compatible.
Comment on lines +4 to +6
// 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.
Copy link
Contributor

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

Comment on lines +143 to +151
// 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.
Copy link
Contributor

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.

Copy link
Author

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.

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