danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 157 forks source link

JavaScript plugin - big file size #144

Closed sandeepbalagopal09 closed 4 years ago

sandeepbalagopal09 commented 4 years ago

The file vendor~plugin-2.4.3.js is 1.3 MB in size. After minifying it is 386.2KB. Is there any way to reduce the file size further ? It is costing dearly when put on s3.

danirus commented 4 years ago

You are right, I will change the build of the bundle to leave ReactJS out of the bundle. That will reduce a lot the size of the bundle.

danirus commented 4 years ago

@sandeepimpressads, the issue has been fixed in v2.5.0. I just released it. Bear in mind that now you have to include the script tags to add React and ReactDOM in your HTML templates. I mean, include the following within your _detail.html file:

<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

I updated that part of the tutorial too.

sandeepbalagopal09 commented 4 years ago

Thanks @danirus let me go through it.

danirus commented 4 years ago

@sandeepimpressads, feel free to reopen the issue if it's not resolved.

sandeepbalagopal09 commented 4 years ago

This is resolved. Thanks.