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

Add WebPack build process and load JS in editor screen #29

Merged
merged 5 commits into from
Aug 13, 2019

Conversation

johnwatkins0
Copy link
Member

@johnwatkins0 johnwatkins0 commented Jul 19, 2019

This will resolve #12.

Description of the Change

  • Sets up a simple ESLint config using the 10up standard and based on other recent 10up plugins.
  • Creates a basic Webpack config with babel-loader and a .babelrc file with env and react presets. It builds a file from src/js into dist.
  • Creates watch and build scripts using Webpack in package.json
  • Creates an assets.php file to enqueue admin scripts and styles, with the necessary logic needed to determine whether to load the new JS assets or the existing JS/CSS created for the pre-5.0 version of the autotweet feature.

Not in this PR

  • This contains no working JS beyond a console.log statement for verification. For core JS dependencies, I made an educated guess of wp-plugins and wp-edit-post, understanding this may need to evolve.
  • This doesn't update the existing JS/CSS built for pre-5.0 WP. The JS will need to be updated later (at least to accommodate the REST endpoint coming with Add REST API endpoint to replace wp_ajax_tenup_auto_tweet [3 hrs.] #14).

Verification Process

Build the JS with npm run watch or npm run build. Verify that the correct JS file loads when the block editor is loaded with a supported post type; verify that the older JS/CSS files load when the classic editor is loaded with a supported post type.

@johnwatkins0 johnwatkins0 added this to the 1.0.0 milestone Jul 19, 2019
@johnwatkins0 johnwatkins0 self-assigned this Jul 19, 2019
@johnwatkins0 johnwatkins0 changed the base branch from feature/default-post-type-support to develop August 8, 2019 01:39
@johnwatkins0 johnwatkins0 changed the title WIP: Add WebPack build process and load JS in editor screen Add WebPack build process and load JS in editor screen Aug 8, 2019
src/js/index.js Outdated Show resolved Hide resolved
src/js/index.js Outdated Show resolved Hide resolved
@johnwatkins0
Copy link
Member Author

Thanks, @adamsilverstein . I removed that test console.log.

Copy link

@adamsilverstein adamsilverstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic!

@johnwatkins0 johnwatkins0 merged commit f45944a into develop Aug 13, 2019
@johnwatkins0 johnwatkins0 deleted the feature/webpack-build-process branch August 13, 2019 02:13
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.

Add a Webpack build process and initial App that loads in Gutenberg [4 hrs.]
2 participants