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

Revisit build process #231

Open
toddmilliken opened this issue Oct 16, 2019 · 0 comments
Open

Revisit build process #231

toddmilliken opened this issue Oct 16, 2019 · 0 comments

Comments

@toddmilliken
Copy link
Contributor

Background

As I was fixing an issue noted by autoprefixer with the linear-gradient syntax in version 3.2.3, @ashleykolodziej had noted that there was some concerns that compile time from sass => css was taking awhile. We troubleshooted this down to postcss process being run on both the css minified file and the non-minified css file. This could be quickly remedied by running postcss once on the non-compiled file, and then minifying it through something like uglify. But then we started talking about revisiting our build process in general.

The following is a list of notes that came out of a meeting on 10/11/19 to revisit our build process needs. We discussed several potential avenues:

Requirements for ideal build process

To help us make decisions, we came up with the following list of requirements:

  • Must be able to compile sass => css
  • es6/bundling capabilities for easier gutenberg/js development and maintenance

Other things to consider:

  • We would need to setup kss, or some other alternative for styleguides
  • Consider Dart Sass as a replacement to node-sass, as this is the primary implementation of Sass, which means it gets new features before any other implementation. However, compile times may be 25% longer (unless this has improved).
  • Consider switching from browserify to webpack. Webpack seems to be used most in WP development at least in gutenberg. Not that there's anything wrong with browserify, but webpack may be more familiar to others.
  • For the Framework theme, the phplint task could probably be done via composer. The current grunt-phplint library is not actively maintained and hasn't been updated in 3 years. Using composer could help unify the correct coding standard we want to apply to projects.
  • Consider locking down browserslist on a project-by-project basis
  • Run autoprefixer once, then minify.
  • Potentially benchmark grunt vs gulp vs npm scripts
  • Grunt is a wrapper around many core node packages, so we depend on grunt versions of these things to exist. By removing grunt, we may have more possibilities utilizing npm scripts. We seem to think npm scripts may be the way for maintenance purposes/simplicity, fewer dependencies/wrappers.

Next steps

We could make a branch off the latest Foundation develop branch, and start with npm scripts from scratch to get sass and webpack working, and then layer on kss. Most of the work involves the following processes:

  • For sass, we need to a workflow like sass => css => postcss/autoprefixer => minified versions
  • For js, we need a workflow like es6 => commonjs + es5 versions => minified versions. The reason we want both commonjs is so the bundles can be imported as a module into other repos as a dependency, and the es5 versions are for immediate browser-use if building directly on top of Foundation.
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

No branches or pull requests

2 participants