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

Move the old Pseudonamespaces to real namespaces #51

Open
rengaw83 opened this issue Jul 3, 2019 · 8 comments
Open

Move the old Pseudonamespaces to real namespaces #51

rengaw83 opened this issue Jul 3, 2019 · 8 comments
Assignees

Comments

@rengaw83
Copy link
Member

rengaw83 commented Jul 3, 2019

Rector does a lot of automated refactoring stuff.
There are already a PseudoNamespace To NamespaceRector we can try to use.

@Baachi
Copy link
Contributor

Baachi commented Aug 13, 2019

I tried to refactor this with rector, but i run into some problems. If run this rector the namespace would be as followed tx\mksearch\engine\interface and not DMK\MKsearch\Engine\Interface.

So i tried to run the RenameNamespaceRector which doesn't have any change.

I try to create PR next week, so we have a good starting point.

@fchaussin
Copy link

Hi @Baachi , did you managed to refactor the Classes with Namspaces? I can help...

@Baachi
Copy link
Contributor

Baachi commented Jan 14, 2020

Hey @fchaussin,

First of all, thanks for your interest and help! 👍

I had two main problems regarding this issue. First of all the usage of the PseudoNamespaceToNamespaceRector and RenameNamespaceRector had some bugs that the resulting namespace wasn't that what I expected. As far as I remember the result was something like this tx\mksearch\engine\interface, which isn't valid in PHP, because interface is a keyword.

The second problem which is more complex is, that the current structure doesn't match with the current state of the art. So rename the namespace isn't enough. For example, this folder/namespace should be converted to DMK\MKSearch\Indexer and the corresponding interface should be moved to this namespace/folder, too.

And last but not least, we need to provide a class map for TYPO3, so we don't introduce a BC break.

All in all, not a big issue, but requires some time and effort.

@Baachi Baachi self-assigned this Jan 14, 2020
@fchaussin
Copy link

Hey @fchaussin,

First of all, thanks for your interest and help! 👍

I had two main problems regarding this issue. First of all the usage of the PseudoNamespaceToNamespaceRector and RenameNamespaceRector had some bugs that the resulting namespace wasn't that what I expected. As far as I remember the result was something like this tx\mksearch\engine\interface, which isn't valid in PHP, because interface is a keyword.

The second problem which is more complex is, that the current structure doesn't match with the current state of the art. So rename the namespace isn't enough. For example, this folder/namespace should be converted to DMK\MKSearch\Indexer and the corresponding interface should be moved to this namespace/folder, too.

And last but not least, we need to provide a class map for TYPO3, so we don't introduce a BC break.

All in all, not a big issue, but requires some time and effort.

Yes that is what I encourted yesterday afternoon, it is a pretty long refactoring, and I will be only able to test the Elastic side. By the way, refactoring namespace is probably the starting point of following the new TYPO3 Extension conventions, and leaving RN_Base dependency. And maybe using PSR-14 based EventDispatcher instead of Hooks...

@Baachi
Copy link
Contributor

Baachi commented Jan 16, 2020

@fchaussin There aren't any plans for v10 but I agree with you, that we can create a better library with all the new shiny features (EventDispatcher, Middleware, DependencyInjection) that come with the new TYPO3 release.

But the main selling point for this library (at least in our opinion) is the compatibility with at least the last two LTS releases (currently it is compatible with v6 - v9). And introduce these features would mean, that we create a completely new library, which requires a bunch of work and effort.

@fchaussin
Copy link

fchaussin commented Jan 17, 2020

@fchaussin There aren't any plans for v10 but I agree with you, that we can create a better library with all the new shiny features (EventDispatcher, Middleware, DependencyInjection) that come with the new TYPO3 release.

But the main selling point for this library (at least in our opinion) is the compatibility with at least the last two LTS releases (currently it is compatible with v6 - v9). And introduce these features would mean, that we create a completely new library, which requires a bunch of work and effort.

I totally agree with you, the good way is to keep it work even with deprececiations. The refactoring is too large to guarantee backward compatibility without too much headache! Reusing the code in a brand new project with the new TYPO3 conventions should be a little easier.

@neufeind
Copy link

neufeind commented Sep 7, 2023

It would be really great to get this going. Since there are several things to redo besides namespaces imho a separate major-version without the aim to provide backward-compatibility (classmap, ...) might be our best bet. Other extensions had similar factorings where a migration-help (what changed, from what to what etc.) would help. I think that's viable for integrators moving to a new major version.

@hannesbochmann
Copy link
Member

In the moment there are no plans to do further development of mksearch. So a refactoring to use namespaces won't happen right now. There will be no new features too, as long as nobody sponsors the development. But we will keep mksearch alive so there will be compatible versions for future TYPO3 versions.

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

No branches or pull requests

5 participants