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

Enhancement/issue 426 restore postcss as plugins #473

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Feb 9, 2021

Related Issue

part of #426

Summary of Changes

This a bit of doozy so here goes....

  1. Created a standalone plugin for PostCSS (moved PostCSS tests from CLI to plugin tests)
  2. Created a standalone plugin for import someCss from './some.css'; syntax
  3. Introduced a new plugin type called rollup (should be self evident 😊 )
  4. General clean up / refactoring of rollup.config.js, decoupling from specific tools, better commenting of used Rollup lifecycles
  5. Established finer grained scope for ResourceInterface.optimization - not really for "bundling", if you need to get involved with bundling / rollup, create / drop in a a rollup plugin
  6. ResourceInterface.serve and ResourceInterface.intercept now get both request and response headers
  7. This should precede Enhancement/issue 434 expand script style link tag production bundling #472 for now, given the extensive refactoring
  8. Updated docs and removed Build docs as Babel / PostCSS are moving to plugins

TODOs

  1. Need to implement a decent default CSS "bundling" solution, e.g. inlining @import rules (as part of Rollup load lifecycle?)
  2. Tests
  3. Documentation
  4. Babel / Browserslist + preset-env (will make as new PR)
  5. Move HTML optimizations from serlialize lifecycle to rollup? - it can wait

Thoughts / Topics for Discussion

  1. If we consider our standard plugins to have default optimization features like terser or cssnano, then it might stand to reason we create a new optimization configuration called 'none', so you can choose to disable it
  2. Might be nice to think of some options for the plugins, like an option to minify, or merge user + default configuration
  3. Would want to open a standalone PR for moving things like terser and json plugins outside of Rollup config, include via rollup plugin
  4. Might be nice to start running all assets through Rollup for optimizing? (img, font, etc)?
  5. named exports are starting to look really good right now... :)

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) RFC Proposal and changes to workflows, architecture, APIs, etc P0 Critical issue that should get addressed ASAP documentation Greenwood specific docs Plugins Greenwood Plugins CLI labels Feb 9, 2021
@thescientist13 thescientist13 self-assigned this Feb 9, 2021
@thescientist13 thescientist13 changed the title Enhancement/issue 426 restore babel and postcss as plugins Enhancement/issue 426 restore postcss as plugins Feb 11, 2021
@thescientist13 thescientist13 marked this pull request as ready for review February 12, 2021 02:48
@thescientist13 thescientist13 linked an issue Feb 14, 2021 that may be closed by this pull request
7 tasks
@thescientist13 thescientist13 force-pushed the enhancement/issue-426-restore-babel-postcss-as-plugins branch from 2e285c0 to 13b8084 Compare February 18, 2021 02:53
@thescientist13 thescientist13 merged commit 1eac905 into release/0.10.0 Feb 18, 2021
@thescientist13 thescientist13 deleted the enhancement/issue-426-restore-babel-postcss-as-plugins branch February 18, 2021 03:01
thescientist13 added a commit that referenced this pull request Apr 3, 2021
* refactor postcss and import css to standalone plugins and refactor ResourceInterfact.intercept signature to include request and response headers

* rollup and css plugin optimization compatibility

* move cli postcss test to postcss plugin specs

* more refactoring and refining

* new rollup plugin API

* postcss optimizations working and prism.css working again

* got script file output working and comment cleanup

* fix postcss config lookup

* sort import order

* remove commented out code

* bundle and link CSS within the CLI and rollup by default

* default css optimizations

* specs for plugin-import-css

* update docs and deleted outdated build docs
thescientist13 added a commit that referenced this pull request Apr 3, 2021
* refactor postcss and import css to standalone plugins and refactor ResourceInterfact.intercept signature to include request and response headers

* rollup and css plugin optimization compatibility

* move cli postcss test to postcss plugin specs

* more refactoring and refining

* new rollup plugin API

* postcss optimizations working and prism.css working again

* got script file output working and comment cleanup

* fix postcss config lookup

* sort import order

* remove commented out code

* bundle and link CSS within the CLI and rollup by default

* default css optimizations

* specs for plugin-import-css

* update docs and deleted outdated build docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) P0 Critical issue that should get addressed ASAP Plugins Greenwood Plugins RFC Proposal and changes to workflows, architecture, APIs, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

restore Babel / PostCSS / Browserslist for no bundle development
1 participant