feat: phase-2 p.o.c: break the app into packages #81
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.
This PR is currently not fully functional, but does show the general concept of how we might want to consider architecting the codebase when we work on making it pluggable.
This is largely based on how Gutenberg does things (in fact the webpack and bin scripts are about 90%+ identical to the Gutenberg repo at the moment).
Anyway, to get an idea of how this works, from the root of the plugin run:
npm installnpm run buildThen re-load the WordPress dashboard. The new IDE won't work anymore (that's expected at this state of this PR), but, what you will see now is that all of the packages are now added to the window under
wpgraphqlIde.You can see this in the browser console:

Much like Gutenberg packages are all added to the window under
wp.:With this architecture, we will be able to build the application using React and following standard practices for building with Components, but will allow for inter-operability between packages, as functions we export will now be available on the window and 3rd parties can interact with the packages without needing to be bundled together.
I wrote up a rough idea on how I see the packages being broken up in the
/packages/README.mdfile (see: https://github.com/wp-graphql/wpgraphql-ide/tree/phase2/implement-packages/packages/README.md)