Skip to content

Conversation

@mcyph
Copy link
Collaborator

@mcyph mcyph commented Jan 4, 2022

Summary

  • Finished converting all files in the core library to TypeScript with type annotations and removed all red underlined errors
  • Batch-converted remaining NaturalDocs to JSDoc and added support for TypeDoc API doc generation
  • Removed the remaining mx* prefixed classes, and made various class name changes for consistency
  • Various bugfixes in the examples

Description for the changelog

Finish converting core to ts, JSDoc conversion, consistency+convention changes, example bugfixes

Other info

Naming/namespace changes:

  • gui modules are renamed from mx* to Max* as e.g. Form or Window are common names and removing mx could cause clashes
  • Renamed Model -> GraphDataModel to indicate it's for the Graph and to indicate how it differs from GraphSelectionModel
  • Renamed all classes implementing GraphPlugin to end with *Handler (e.g. RubberBand -> RubberBandHandler) to keep with this convention
  • Moved various functions in utils to different files like mathUtils or styleUtils for categorisation

Serialisation still doesn't work largely because of the graph having different parameters to before and the GraphCodec needing to be updated, but progress has been made in allowing all other serialisers to be registered without recursive import problems by moving them into the files where they are used. It should be possible to finish the remaining issues to make it function again reasonably easily, but there needs to be some discussion around backwards compatibility and how the XML format will relate to a potential JSON format etc.

More info about this branch in the comments at #64.

@mcyph mcyph linked an issue Jan 4, 2022 that may be closed by this pull request
Copy link
Collaborator

@junsikshim junsikshim left a comment

Choose a reason for hiding this comment

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

Great work!
Obviously, it's impossible to review all the changed code at this stage, but I feel confident about the direction we're heading.
Also, the docs look neat :)

As Dave mentioned, we need to talk about xml components and maybe gui components. I haven't used both of them in my applications, so I can't really decide whether we actually need them nor how much we need to keep them in the same previous format(change XML to JSON?).

@mcyph mcyph merged commit 413796a into development Jan 8, 2022
@mcyph
Copy link
Collaborator Author

mcyph commented Jan 8, 2022

@junsikshim yep, I've merged+squashed into a single commit as don't think there's much good reason to show the million and one commits I've made :P

I'm personally of the view that the GUI components can stay - I don't think they require much time to maintain, and could allow previous users of the library to more easily port applications (though maybe we should note in the docs they're mainly kept in the lib for previous apps and not recommended for new ones, as there's a lot of good UI control libs nowadays).

I don't necessarily think we should remove support for XML, but currently the way the serializers work is they convert to XML first then JSON. I think this code could be easier to maintain going forwards if the lib encodes the other way around - to JSON, then convert to XML, but should look more into this before coming to a conclusion.

@tbouffard
Copy link
Member

Thanks @mcyph for this massive improvements. As @junsikshim I cannot really review everything but I am sure we are heading in the right direction.
I am currently doing some testing with the new code and I will make some feedback for sure.

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

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert JS files to TS

3 participants