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

Migrate from Kryo to Json for project files #208

Merged
merged 10 commits into from
Aug 24, 2023
Merged

Migrate from Kryo to Json for project files #208

merged 10 commits into from
Aug 24, 2023

Conversation

JamesTKhan
Copy link
Owner

@JamesTKhan JamesTKhan commented Aug 3, 2023

This PR will switch Mundus over to storing the .registry and project .pro files in JSON format, using libGDX's json library.

JsonIOManager replaces KryoManager. I added MigrationIOManager class which is used for Dependency Injection going forward. On registry load it checks if registry is a kryo file, if so, it backs it up, then migrates it to JSON then loads the registry as JSON.

On Project Load, if the .pro file appears to be a kryo file, also backs it up then migrates that .pro file to JSON.

Several reasons for this decision:

  1. Issue Build issues on newer JDK's (workaround available) #170 because we use TaggedFieldSerializer in Kryo, any JDK above 1.8 causes an exception. While a workaround is available I have had atleast 3-4 people contact me on discord having this issue and not knowing how to resolve it. This is concerning as it discourages new users of Mundus right off the bat and requiring them to add jvm workarounds if using a JDK > 1.8 is not a good long term fix.

  2. Using Kryo makes these files more dangerous to modify (personal opinion). For example, this warning here:

    // !!!!! DO NOT CHANGE THIS, OTHERWISE ALREADY SERIALIZED OBJECTS WILL

  3. It is now easy to view the contents of these files, and edit them if for some reason they become corrupted which cannot be done with Kryo.

  4. The .registry files and .pro don't hold much information, so the file size increase is trivial

For the time being KryoManager and the MigrationIOManager will stay in the repo to support backward compatibility. Ideally at some future date, they can be removed.

@JamesTKhan JamesTKhan linked an issue Aug 3, 2023 that may be closed by this pull request
# Conflicts:
#	editor/src/main/com/mbrlabs/mundus/editor/core/project/ProjectManager.java
@JamesTKhan JamesTKhan marked this pull request as ready for review August 3, 2023 17:48
@JamesTKhan JamesTKhan added this to the 0.6.0 Release milestone Aug 3, 2023
# Conflicts:
#	editor/src/main/com/mbrlabs/mundus/editor/Mundus.kt
#	editor/src/main/com/mbrlabs/mundus/editor/core/project/ProjectManager.java
# Conflicts:
#	editor/src/main/com/mbrlabs/mundus/editor/Mundus.kt
@JamesTKhan JamesTKhan merged commit 1be5f70 into master Aug 24, 2023
@JamesTKhan JamesTKhan deleted the iomanager branch August 24, 2023 04:55
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.

Build issues on newer JDK's (workaround available)
1 participant