Automattic / Automattic/jetpack

Boost: Clean up Viewport classes and configuration

Open
#20,562 2 comments 0 reactions 0 assignees View on GitHub
[Boost Feature] Critical CSS [Plugin] Boost [Type] Janitorial
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Originally posted by @pyronaur.

Configuration is setting up multiple viewport configuration variables and it's not clear how they're used or what they do::

https://github.com/Automattic/jetpack/blob/29ccc2fc37522edf221a2e38363fae87516b7345/projects/plugins/boost/app/class-jetpack-boost.php#L417-L428

Half of the code in [`class Viewport`](https://github.com/Automattic/jetpack/blob/master/projects/plugins/boost/app/lib/class-viewport.php) seems to be unused, and when we use viewports, we define them without actually using the config anyway:

https://github.com/Automattic/jetpack/blob/29ccc2fc37522edf221a2e38363fae87516b7345/projects/plugins/boost/app/modules/critical-css/class-critical-css.php#L36-L52

I think we need to re-think how we deal with options and customization. Making everything hot-swappable makes the configuration also obscure and difficult to work with, so we end up just localizing the values to the code we're working with anyway, ending up in more confusion everywhere else.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the configuration in projects/plugins/boost/app/class-jetpack-boost.php, the Viewport implementation in projects/plugins/boost/app/lib/class-viewport.php, and its use in projects/plugins/boost/app/modules/critical-css/class-critical-css.php. Trace which viewport options are read or unused, then clarify the intended configuration and customization model before defining what cleanup is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.