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

fix: infite loop in some demo when deploy #961

Merged
merged 1 commit into from
May 16, 2024
Merged

Conversation

xjiang-at-wiris
Copy link
Contributor

@xjiang-at-wiris xjiang-at-wiris commented May 9, 2024

Description

With the current webpack configuration, when deploying demos, the entire editor gets copied over, including some unnecessary files. Due to caching mechanisms, webpack continuously detects changes in the source files of the TinyMCE editor, triggering continuous hot reloads.

This change will exclude those mentioned files during deployment, retaining only the minified or required files as they are the ones actually needed.

Steps to reproduce

  • Clean the dist directories of all demos. (For example, execute git clean -dfx)
  • Buid and run all demos, and repleat muliple times without clean the environment
  • Ensure there is no infinite loop
  • Ensure both editor & Mathtype functionality works without error

Changes.md

fix: Exclude certain unnecessary files that are copied over during the deployment of TinyMCE 5 & TinyMCE 6 & CKEditor 4 demos to prevent an infinite loop. #KB-44423


#taskid 44423

Copy link
Contributor

@carla-at-wiris carla-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyMCE 5 & 6 work perfect!

The block still happens on CKEditor4, not on the 5 though.

@xjiang-at-wiris
Copy link
Contributor Author

TinyMCE 5 & 6 work perfect!

The block still happens on CKEditor4, not on the 5 though.

thanks, fixed!

@jgonzalez-at-wiris
Copy link
Contributor

Would be interesting to complement your changes with a removal of the dists folders so we make sure that directories are empty every time we start the project: https://github.com/johnagan/clean-webpack-plugin. CC @carla-at-wiris

Copy link
Contributor

@usantos-at-wiris usantos-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested all HTML demos, and didn't find any issues! Do we know why these 3 and not the other editors ? It makes sense to change froala, generic, ck5, and the viewer to this new config ? Great job!

@xjiang-at-wiris
Copy link
Contributor Author

Tested all HTML demos, and didn't find any issues! Do we know why these 3 and not the other editors ? It makes sense to change froala, generic, ck5, and the viewer to this new config ? Great job!

Good question!

The core error in the problem was that the dist folder was repeatedly written and mixed in when building and packaging the project, including some problematic files (For example, we need some code from Tiny to run Tiny editor in our demo).

So, the generic and viewer components didn't need any changes. They shouldn't have used any third-party assets from the beginning.

The architecture of CKEditor 5 and CKEditor 4 is completely different. So, for some unknown reason, we didn't need to include CK5 files in the dist folder to run the editor.

Froala is most likely to encounter a similar problem because it also packages the entire editor. However, fortunately, it didn't cause any errors. Of course, if the goal is to maintain cleanliness, Froala should be cleanable as well.

@carla-at-wiris carla-at-wiris self-requested a review May 13, 2024 09:38
@carla-at-wiris carla-at-wiris merged commit 3fff14a into master May 16, 2024
13 checks passed
@xjiang-at-wiris xjiang-at-wiris deleted the KB-44423 branch May 16, 2024 15:32
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.

None yet

4 participants