-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: phase-2 p.o.c: break the app into packages #81
Draft
jasonbahl
wants to merge
10
commits into
main
Choose a base branch
from
phase2/implement-packages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…litting all the components into "packages"
- enqueue the scripts for each package
- pin chalk to 4.1.1 based on gutenberg's implementation - install fast-glob, node-watch, progress as dev deps - ignore blocksConfig from webpack for now
- define module in package.json for each package - add .npmrc files to packages (see: https://github.com/WordPress/gutenberg/blob/f1af91a70a9140d569a92b29107b118f5cd91871/packages/README.md?plain=1#L39) - add initial state for packages/app
This reverts commit cc42ee8.
This was referenced Apr 23, 2024
josephfusco
changed the title
phase-2 p.o.c: break the app into packages
feat: phase-2 p.o.c: break the app into packages
Jun 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 install
npm run build
Then 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.md
file (see: https://github.com/wp-graphql/wpgraphql-ide/tree/phase2/implement-packages/packages/README.md)