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

Get rid of frontend dependencies #161

Open
getup8 opened this issue Jun 5, 2020 · 13 comments
Open

Get rid of frontend dependencies #161

getup8 opened this issue Jun 5, 2020 · 13 comments
Milestone

Comments

@getup8
Copy link

getup8 commented Jun 5, 2020

First off, thanks for creating such a great app, it has a ton of functionality and seems well built.

Just wanted to give some feedback after going through the tutorial, feel free to do with it what you will :)

It would be amazing if this could have zero dependencies (besides django-contrib-comments of course). But needing to use React, jQuery and Bootstrap from the get go is a lot to ask if you're using another CSS library (or none at all) and VanillaJS or another JS library. Maybe consider a VanillaJS implementation with some basic styling as the default version instead? And then have plugins / extensions? I know that'd be a lot of work..

Also, a setting that just didn't allow commenting / interacting with comments for anon users would be nice. Doesn't seem to exist unless I misread.

@danirus
Copy link
Owner

danirus commented Jun 5, 2020

I do fully agree. It is a lot of work, but it's worth the effort.
I have been thinking about it since a year but didn't have time to put on it.

About anonymous users, next release 2.6.2 will explain how to customize the app so that it doesn't allow anonymous users to post comments. It's in branch issue-140.

@getup8
Copy link
Author

getup8 commented Jun 5, 2020

That's great you've been thinking about it and are planning on it!

The new "only users can post" enhancement is great too.

I might play around with a VanillaJS implementation so will let you know if I get anywhere.

@ashwani99
Copy link
Contributor

@danirus @getup8 To add to this discussion, I think at this moment, the JS plugin is too much tied up with the django-comments-xtd package itself. I think it should be separated out with less dependencies as @getup8 mentioned. Along with that, it would be nice if there's an option to extend the JS plugin so anyone can work on top of it

@danirus danirus pinned this issue Jun 20, 2020
@danirus danirus changed the title Some quick feedback Get rid of frontend dependencies Sep 21, 2020
@danirus danirus added this to the 3.0.0 milestone Sep 27, 2020
@jhancia
Copy link

jhancia commented Nov 17, 2020

Hello, thanks for this excellent package. Wondering if there's an ETA for this vanilla javascript release. Have a deadline coming up and we'd love to use django-comments-xtd with the ajax javascript plugin. Despite experience with jQuery and bootstrap, our team isn't familiar with react and we weren't able to get it working.

We are also using bootstrap 3 and while we were able to modify a few of the templates to use the old bootstrap 3 classes, it looks like we'll need to modify the js plugin as well to continue using bootstrap 3. Some packages like crispy-forms have a 'bootstrap_version' setting where users can set the value to 'bootstrap 3', 4 or 5, and the package includes those different versions of the templates. That would be another excellent feature (not sure how much work it is!) It might be possible to include the previous versions of the templates and choose which ones to display based on the setting. Thanks so much.

@danirus
Copy link
Owner

danirus commented Nov 18, 2020

Hi @jhancia, there is no estimation. I started working on it as part of other major changes in the app (branch issue-210, which uses a new model CommentReaction instead of CommentFlag). I wish I could have it by the end of the year, but at the current pace of development I am afraid I will extend beyond those dates.
In the meanwhile if you need help integrating the current plugin based on ReactJS, please, open an issue here in GitHub or write me an email.

@tian-yan
Copy link

Same here, I want to express my gratitude to the team for this awesome package.
In regards to the front-end dependency, even though this package has built-in support for JavaScript and BootStrap, I did not used them at all. In fact, my website under-development was built with TailwindCSS (not BootStrap) and I aims to build a Pure CSS front-end as I am very demanding in light-weight and customizing-flexibility.

@danirus danirus linked a pull request Feb 17, 2022 that will close this issue
@danirus danirus mentioned this issue Feb 17, 2022
@Mte90
Copy link

Mte90 commented Jan 29, 2024

So I was looking on how to use this project with Tailwind (it is just a template file so it shouldn't be difficult) but as others wrote the issue is the JS framework.
I don't want react, I am more interested in HTMX but if it is JS vanilla it will be better.

I see various ticket for version3 that should remove the React plugin but they are very old information.

How we can help to move on the version 3.0?

@danirus
Copy link
Owner

danirus commented Jan 30, 2024

The work to have a ReactJS-free and Bootstrap-free django-comments-xtd was moved to the comment's ink organization:

  • django-comments-ink: was started out of the django-comments-xtd rel-3.0.0 branch, and it evolved a lot since then. It has tests for both backend and frontend. The frontend is vanilla JavaScript. And the UI uses plain CSS, not even SCSS.
  • dci-project-quotes is an example site without frontend code using vanilla CSS.
  • dci-project-stories is an example site using vanilla JS and CSS.

I didn't work on the project since almost two years. I do not consider it ready to use because the templating is over-complicated and caching comments is too messy.

@Mte90
Copy link

Mte90 commented Jan 30, 2024

Yeah I saw that the project doesn't get updates since 2 years, so we can consider the 3.0 milestone abandoned and that this project is like in maintenance mode on 2.9.x branch with react.

@danirus
Copy link
Owner

danirus commented Jan 30, 2024

About django-comments-ink, postponed rather than abandoned describes better the current situation. About django-comments-xtd, it will stay with the ReactJS plugin and Bootstrap.

@Mte90
Copy link

Mte90 commented Jan 31, 2024

So I did:

With those changes Remarkable and Django libraries are used only if available.
So I think that can be generated a bundle that includes also the React-dom/react libraries in this way it will be just a unique JS.

@Mte90
Copy link

Mte90 commented Feb 7, 2024

Reading the JS code the bootstrap templating is defined in the jsx file so to switch to Tailwind is required to change the code and compile it:

<div id={`c${data.id}`} className="comment d-flex">

@danirus
Copy link
Owner

danirus commented Feb 12, 2024

So I did:

With those changes Remarkable and Django libraries are used only if available. So I think that can be generated a bundle that includes also the React-dom/react libraries in this way it will be just a unique JS.

As I commented in PR #420, none of the two mentioned PRs (#417 and #420) remove the dependencies referred to in this issue, which are the Bootstrap UI library and ReactJS.
Thank you anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants