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

Implement toolkit API #374

Merged
merged 37 commits into from
Jul 30, 2021
Merged

Implement toolkit API #374

merged 37 commits into from
Jul 30, 2021

Conversation

pcardune
Copy link
Collaborator

@pcardune pcardune commented Jul 9, 2021

This PR attempts to refactor and consolidate all the code and configuration that was copy/pasted across codemirror-blocks, wescheme-blocks, and pyret-blocks into a small "toolkit" library that lives in "src/toolkit". Here is a summary of the changes:

  • npm run build will generate a lib/ directory containing transpiled commonjs versions of all the files in src/, allowing dependents to import individual files from codemirror-blocks with require("codemirror-blocks/lib/<filename>");
  • we will no longer generate a dist/ directory with CodeMirrorBlocks-min.js bundles. This responsibility was long ago pushed to pyret-blocks and wescheme-blocks
  • common code and configuration for running/writing tests, generating bundles, and running a local development server will live in "src/toolkit" and be accessible from wescheme-blocks and pyret-blocks via require("codemirror-blocks/lib/toolkit/<module>")

TODO BEFORE MERGE:

@pcardune pcardune marked this pull request as ready for review July 29, 2021 00:26
@pcardune
Copy link
Collaborator Author

@schanzer I believe this is ready to merge. There are more changes to be made in pyret-blocks and wescheme-blocks, but my pull requests in those repos address the main compatibility issues that would prevent this PR from being merged.

@schanzer
Copy link
Member

schanzer commented Jul 30, 2021

@pcardune this is huge. Thank you!!

Before I merge, I want to confirm that you're intentionally leaving one of the TODO items unchecked? I'm also curious about why the extendSelectionX apis are commented out in BlockEditor.tsx, as it looks like you did some work on their implementation.

@pcardune
Copy link
Collaborator Author

Yes, I'm intentionally leaving one of the TODO items unchecked.

The extendSelectionX apis are commented out in BlockEditor.tsx because they are in fact supported by the block editor. I commented them out from the list of "unsupported apis" instead of just removing them from the list to match the on and off APIs.

I'll go ahead and merge this PR and the corresponding PRs for wescheme-blocks and pyret-blocks. Since the pyret-blocks and wescheme-blocks repos have always pointed to the latest commit in the codemirror-blocks master branch instead of a specific commit hash, all old commits to wescheme-blocks and pyret-blocks will probably be broken because they will be pointing to a version of codemirror-blocks that is no longer compatible. Likewise, any outstanding branches in wescheme-blocks and pyret-blocks will probably also break until they merge master.

@pcardune pcardune merged commit aa837ab into master Jul 30, 2021
@pcardune pcardune deleted the pcardune-toolkit branch July 30, 2021 16:30
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.

Split testing infrastructure off into a separate webpack bundle
2 participants