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

App based on this sample #1

Open
delneg opened this issue Oct 16, 2022 · 6 comments
Open

App based on this sample #1

delneg opened this issue Oct 16, 2022 · 6 comments

Comments

@delneg
Copy link

delneg commented Oct 16, 2022

Although I'm still debugging issues happening in runtime (which is currently pretty painful because I have to build it in production & replace django template base.html filenames, but I'll figure it out) - you probably might be interested because it's a pretty complex code, using all sorts of Fable features, new & old.
The app itself is a F# React frontend for a Django-based chat backend plugin, which was previously written in part js / part F#, but now is 100% F#.
Bearle/django_private_chat2#41
@alfonsogarciacaro

@alfonsogarciacaro
Copy link
Owner

This is nice @delneg! Thanks for letting me know! Do you mean you have already used JSX in a real Fable app? If so, can you please link to the file containing the Fable JSX code?

@delneg
Copy link
Author

delneg commented Oct 18, 2022

This is nice @delneg! Thanks for letting me know! Do you mean you have already used JSX in a real Fable app? If so, can you please link to the file containing the Fable JSX code?

Well, I'm working it out. Right now I'm having troubles debugging what seems like "react-chat-elements" library issues, because of the React v17 vs React v18 differences & changes, and the fact new Fable setup that it doesn't work with React < 18.
But anyway, you can have a look at https://github.com/Bearle/django_private_chat2/blob/feat/full-fs/example/frontend/src/App.fs
That's the main file that contains all the JSX as well as the Elmish loop

@delneg
Copy link
Author

delneg commented Oct 19, 2022

@alfonsogarciacaro
I've fixed most of the issues, and the compiled app is included in the repo as "index.js"
You can try it out following the steps in the README for the example app: https://github.com/Bearle/django_private_chat2/blob/feat/full-fs/example/README.md
P.S. It can be python3.10 or newer,not necessarily python3.9 , and "localhost" won't work, only 127.0.0.1

@alfonsogarciacaro
Copy link
Owner

Nice that you made it work with React 18. We can try to adapt useElmish to React 17, but it's a bit difficult without the new hook.

Would it be ok to edit it the useElmish post to include a reference to your app?

@delneg
Copy link
Author

delneg commented Oct 21, 2022

Nice that you made it work with React 18. We can try to adapt useElmish to React 17, but it's a bit difficult without the new hook.

Would it be ok to edit it the useElmish post to include a reference to your app?

I don't know if it's necessary to backport useElmish to React 17, but just in case - can't the new hook be included in the useElmish itself, if it's a dependency ?

Also, regarding the reference to the app - it would be great!
Although this piece of code is surely not the best example, it's something

@alfonsogarciacaro
Copy link
Owner

Also, regarding the reference to the app - it would be great!

Will do, thanks!

I don't know if it's necessary to backport useElmish to React 17, but just in case - can't the new hook be included in the useElmish itself, if it's a dependency ?

Ah, you're right! We can just polyfill the hook 😅 We can do that if there are other users that want to use Fable.React.UseElmish and cannot upgrade to React 18.

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

No branches or pull requests

2 participants