-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add template tag to enable react-refresh #53
Add template tag to enable react-refresh #53
Conversation
Thanks for your PR but your code generates something for a specific frontend framework.
I think |
I’m a little confused, didn’t you say in #14 that you would accept a PR with this functionality?
Do you have an example of what you think this might lead to? I think react refresh is a special case because this is a known issue with Vite react that every other vite adapter I’ve seen handles. It’s more of a bug fix than an enhancement because it’s required for React to work with Vite. |
Of course I will accept a PR, I didn't see that React is an official plugin of Vite so we could add it. So I think Thanks for your PR, can you just make it more configurable and add some comments ? And I will merge your PR. |
I'm happy to make changes, but I'm genuinely not sure what you're looking for. Both methods I added already have doc-blocks and there isn't much to configure. I added a setting for users to override the react-refresh url, but I don't even think that's necessary. Non-react users simply won't add the template tag, so there's nothing more that needs to be done there. Let me know if there's something specific you're looking for! |
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.
Looks good to me! @MrBin99 would you please take another look?
Same for me, looks good. Could you @MrBin99 review it please? |
I suspect this project has been abandoned. Since I maintain a project that's downstream of this, I think I'm going to fork it for a re-release. For those of you commenting here, is there anywhere (maybe discord?) that this project is discussed I could join? |
A fork that keeps getting maintained would be very nice! If you need any help with the maintenance, I'm happy to do help with that. I'm not sure if there is a space for discussions anywhere, maybe start a discussion in this repository? Or submit an issue with the proposal to possibly take over this project? Because it would be nice to keep the name 'django-vite'. |
I can help too. |
Regarding #70 , @BrandonShar @AlessandroSalvetti and possibly others, would you be interested in a collaboration to revitalize this project? |
It still looks good to me so I'll merge this! |
This PR adds a template tag called
vite_react_refresh
to handle providing the extra code needed to support react hot module reloading.This was discussed a bit in #14 and #15 and while it is project specific and only relevant for react users, having this tag be part of the package is inline with other framework community adapters like Vite Rails and Vite Laravel
I wasn't sure how'd you like to format the multi-line string needed, but since it's dev only I figured the indenting didn't matter much. If you disagree, let me know and I'll revise it!
Thanks for this great repo!