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 763 custom css minification and bundling #980

Merged

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Oct 1, 2022

Related Issue

#763

As an alternative / exploration to #977 and some of the challenges I encountered there trying to preserve existing functionality

Summary of Changes

  1. Initial prototype of using an AST to faithfully transform CSS output
  2. Removes PostCSS related dependencies from CLI
  3. Support inlining of (deeply nested) @import

TODO

  1. Restore minification / get specs passing
  2. Restore inlining relative @import
  3. Handle nested relative @import
  4. restore website styling
  5. Flesh out syntax transformations
  6. Update website / docs (if applicable)
  7. Review parser options
  8. Refactoring / code clean up

As a bonus, seems like with this we could support nesting without needing to rely on PostCSS!? 🤩
csstree/csstree#79

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) website Tasks related to the projects website / documentation documentation Greenwood specific docs labels Oct 1, 2022
@thescientist13 thescientist13 added this to the 1.0 milestone Oct 1, 2022
@thescientist13 thescientist13 self-assigned this Oct 1, 2022
@thescientist13 thescientist13 changed the base branch from master to release/0.27.0 October 1, 2022 17:13
@thescientist13 thescientist13 mentioned this pull request Oct 1, 2022
27 tasks
@thescientist13 thescientist13 added Plugins Greenwood Plugins CLI labels Oct 22, 2022
@thescientist13 thescientist13 marked this pull request as ready for review October 22, 2022 01:14
@thescientist13 thescientist13 removed the website Tasks related to the projects website / documentation label Oct 22, 2022
@thescientist13 thescientist13 force-pushed the enhancement/issue-763-custom-css-bundling branch from 024d55d to 935e292 Compare November 3, 2022 01:03
color: var(--secondary-color);
}

div > p {
Copy link
Member Author

Choose a reason for hiding this comment

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

maybe need to test ~

* add cloud IDE caveat to puppeteer renderer plugin readme (#967)

* init commit of refactoring for script tags with a src

* initial CSS optimizing

* sync optimized link tags in final output

* refactored for shared reources

* handle inline script bundling

* support serving custom resources using Greenwood plugins in Rollup configuration without needing extra rollup plugin

* non resource related Rollup plugins supported

* custom resource plugins and rollup plugins working together

* handle empty input for Rollup

* updated lock file

* handle inline style tag bundling and optimizing

* default optimization spec passing

* refactor merging app and page templates

* clarifying corrections in spec files

* inline optimization config working

* none optimization support

* none optimization support

* none and static optimization overrides

* refactor html rendering and optimizing

* refactoring and more CLI specs passing

* add missing variable

* SSR specs and optimizing resource bundling

* minor refactoring and logging

* resolving some plugin specs

* restore develop command related GraphQL specs

* custom graphql query spec

* all specs passing

* drop rollup plugin deps from import typescript plugin

* all Greenwood commands and specs passing

* restore static router with custom prerender

* restore postcss-import

* refactor shared resources to a Map and handle dupes

* restore local packages workaround for local Rollup bundling

* better monorepo Rollup facade modules detection

* switch console log

* remove console logging

* update plugin related docs

* local solution for windows support

* refactor errant object assign

* full cross platform URL support

* fix lint

* fix extra bundles when custom prerendering

* clean up stale or already tracked TODOs

* add nested head tag smoke tests

* check for app template validation for HUD display

* misc refactoring and TODOs cleanup

* restore static router (again)

* standardize passing correct reference for prerender scripts

* clean up data-gwd-opt markers from final HTML
@thescientist13 thescientist13 force-pushed the enhancement/issue-763-custom-css-bundling branch from 935e292 to 0e54ed9 Compare November 11, 2022 15:38
@thescientist13 thescientist13 changed the title Enhancement/issue 763 custom css bundling Enhancement/issue 763 custom css minification and bundling Nov 11, 2022
@thescientist13 thescientist13 merged commit 9e792ae into release/0.27.0 Nov 12, 2022
@thescientist13 thescientist13 deleted the enhancement/issue-763-custom-css-bundling branch November 12, 2022 17:40
thescientist13 added a commit that referenced this pull request Nov 12, 2022
* Enhancement/issue 971 refactor bundling and optimizations (#974)

* add cloud IDE caveat to puppeteer renderer plugin readme (#967)

* init commit of refactoring for script tags with a src

* initial CSS optimizing

* sync optimized link tags in final output

* refactored for shared reources

* handle inline script bundling

* support serving custom resources using Greenwood plugins in Rollup configuration without needing extra rollup plugin

* non resource related Rollup plugins supported

* custom resource plugins and rollup plugins working together

* handle empty input for Rollup

* updated lock file

* handle inline style tag bundling and optimizing

* default optimization spec passing

* refactor merging app and page templates

* clarifying corrections in spec files

* inline optimization config working

* none optimization support

* none optimization support

* none and static optimization overrides

* refactor html rendering and optimizing

* refactoring and more CLI specs passing

* add missing variable

* SSR specs and optimizing resource bundling

* minor refactoring and logging

* resolving some plugin specs

* restore develop command related GraphQL specs

* custom graphql query spec

* all specs passing

* drop rollup plugin deps from import typescript plugin

* all Greenwood commands and specs passing

* restore static router with custom prerender

* restore postcss-import

* refactor shared resources to a Map and handle dupes

* restore local packages workaround for local Rollup bundling

* better monorepo Rollup facade modules detection

* switch console log

* remove console logging

* update plugin related docs

* local solution for windows support

* refactor errant object assign

* full cross platform URL support

* fix lint

* fix extra bundles when custom prerendering

* clean up stale or already tracked TODOs

* add nested head tag smoke tests

* check for app template validation for HUD display

* misc refactoring and TODOs cleanup

* restore static router (again)

* standardize passing correct reference for prerender scripts

* clean up data-gwd-opt markers from final HTML

* v0.27.0-alpha.0

* (WIP) swap PostCSS in CLI with custom AST solution

* refactor website CSS

* basic implementation of minified CSS from AST

* support relative @import statements

* refactor AST parsing to recursive function

* support deeply nested @import and CSS custom properties

* fix  missing declaration semicolon

* correctly close Rule brackets

* general on leave refactoring

* more selector support

* all specs passing

* support percentage

* test for percentage

* support url and @import url

* add important support

* custom implementation for handling matchers in attribute selectors

* restore website prism styles

* nth and lang selectors support

* improve support for matching selector types

* add error logging for CSS parsing
thescientist13 added a commit that referenced this pull request Nov 23, 2022
* Enhancement/issue 971 refactor bundling and optimizations (#974)

* add cloud IDE caveat to puppeteer renderer plugin readme (#967)

* init commit of refactoring for script tags with a src

* initial CSS optimizing

* sync optimized link tags in final output

* refactored for shared reources

* handle inline script bundling

* support serving custom resources using Greenwood plugins in Rollup configuration without needing extra rollup plugin

* non resource related Rollup plugins supported

* custom resource plugins and rollup plugins working together

* handle empty input for Rollup

* updated lock file

* handle inline style tag bundling and optimizing

* default optimization spec passing

* refactor merging app and page templates

* clarifying corrections in spec files

* inline optimization config working

* none optimization support

* none optimization support

* none and static optimization overrides

* refactor html rendering and optimizing

* refactoring and more CLI specs passing

* add missing variable

* SSR specs and optimizing resource bundling

* minor refactoring and logging

* resolving some plugin specs

* restore develop command related GraphQL specs

* custom graphql query spec

* all specs passing

* drop rollup plugin deps from import typescript plugin

* all Greenwood commands and specs passing

* restore static router with custom prerender

* restore postcss-import

* refactor shared resources to a Map and handle dupes

* restore local packages workaround for local Rollup bundling

* better monorepo Rollup facade modules detection

* switch console log

* remove console logging

* update plugin related docs

* local solution for windows support

* refactor errant object assign

* full cross platform URL support

* fix lint

* fix extra bundles when custom prerendering

* clean up stale or already tracked TODOs

* add nested head tag smoke tests

* check for app template validation for HUD display

* misc refactoring and TODOs cleanup

* restore static router (again)

* standardize passing correct reference for prerender scripts

* clean up data-gwd-opt markers from final HTML

* v0.27.0-alpha.0

* (WIP) swap PostCSS in CLI with custom AST solution

* refactor website CSS

* basic implementation of minified CSS from AST

* support relative @import statements

* refactor AST parsing to recursive function

* support deeply nested @import and CSS custom properties

* fix  missing declaration semicolon

* correctly close Rule brackets

* general on leave refactoring

* more selector support

* all specs passing

* support percentage

* test for percentage

* support url and @import url

* add important support

* custom implementation for handling matchers in attribute selectors

* restore website prism styles

* nth and lang selectors support

* improve support for matching selector types

* add error logging for CSS parsing
@thescientist13 thescientist13 linked an issue Oct 17, 2023 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.3 CLI documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) Plugins Greenwood Plugins v0.27.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

browserslist is outdated
1 participant