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

Cleanup deprecated types #332

Merged
merged 2 commits into from
Feb 15, 2023
Merged

Cleanup deprecated types #332

merged 2 commits into from
Feb 15, 2023

Conversation

tortmayr
Copy link
Contributor

@tortmayr tortmayr commented Jan 2, 2023

Ensure that deprecated types are isolated and don't leak into non-deprecated definitions. => Consistently use definitions from sprotty protocol in non-deprecated classes,functions or type definitions.

@tortmayr tortmayr requested review from planger and spoenemann January 2, 2023 09:34
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

Thanks!

This reminds me of a thought: shall we rename the internal model classes such as SNode, SEdge in order to avoid the name conflict with the protocol interfaces? This name clash is rather confusing for users (where do I need to import that from?)

Example: SNodeImpl, SEdgeImpl etc.

packages/sprotty/src/base/ui-extensions/ui-extension.ts Outdated Show resolved Hide resolved
packages/sprotty/src/base/model/smodel.ts Outdated Show resolved Hide resolved
@tortmayr
Copy link
Contributor Author

Thanks!

This reminds me of a thought: shall we rename the internal model classes such as SNode, SEdge in order to avoid the name conflict with the protocol interfaces? This name clash is rather confusing for users (where do I need to import that from?)

Example: SNodeImpl, SEdgeImpl etc.

I aggree, we definitely have to find a cleaner solution than the way we handle it right now. However, I'm not sure if renaming the internal model is the way to go here. This would introduce a major API break and affects a large part of the code base.

We could also go the other way round and rexport sprotty-protocol as part of sprotty with some modifications i.e. renaming the clashing interfaces from sprotty protocol. (e.g. SModel -> SModelSchema). This would also mean users can simply import everything directly from sprotty and we don't break the existing API.

Pros and Cons for both approaches so we probably should discuss & handle this in a follow-up.
It might also be time to remove the deprecated action types as they also contribute to this whole name clashing confusion.

@spoenemann
Copy link
Contributor

spoenemann commented Jan 16, 2023

This would introduce a major API break and affects a large part of the code base.

That's true. But I would prefer such an API break for the transition to version 1.0 over keeping a confusing naming scheme for years to come. I'm not sure re-exporting with different names is the best option – in the worst case, that would increase the confusion.

@dhuebner
Copy link
Contributor

@tortmayr
PR is approved. Should we merge it?

Ensure that deprecated types are isolated and don't leak into non-deprecated  definitions.
=> Consistently use definitions from sprotty protocol in non-deprecated  classes,functions or type definitions.
@tortmayr
Copy link
Contributor Author

@spoenemann I have rebased the change and addressed the two open comments/issues.
We should probably handle the renaming oft the internal model classes with a follow-up PR.

Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

Thanks!

@tortmayr tortmayr merged commit f0c9821 into master Feb 15, 2023
@tortmayr tortmayr deleted the tortmayr/cleanup branch July 28, 2023 00:39
@tortmayr tortmayr added this to the v0.14.0 milestone Aug 22, 2023
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.

3 participants