Feature: Support Magewire in the backend #139
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Last week during the pre-Meet Magento NL Hackathon, I hacked together a proof of concept on getting Magewire to work in the backend of Magento. This PR is the result of that. Next to that, this PR and repository are also required:
The RequireJS adjustments are made as the backend also needs RequireJS support, but the module has a dependency on customer data. It is not required to make it work in the backend, though. Next to that, the form key in the backend is being retrieved differently than in the frontend.
The solution lies mainly in moving configuration from
etc/frontend/di.xml
toetc/di.xml
, and frometc/frontend/events.xml
toetc/events.xml
. Also, a controller is created in theadminhtml
folder, but that extends upon the frontend controller without any changes.A big question that popped up during the hackathon was what about security? Magewire relies on the form key, which by accident makes it a little bit secure, but the controller does not have any extra security built in. Also, another thing that should be thought about is ACLs.
I have the code for the backend in a separate repository. It is worth considering whether this is the right approach or whether it should be merged into the main repository.