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

Introduce whitelisted level 1 optimizations #889

Closed
jakubpawlowicz opened this issue Feb 9, 2017 · 0 comments
Closed

Introduce whitelisted level 1 optimizations #889

jakubpawlowicz opened this issue Feb 9, 2017 · 0 comments

Comments

@jakubpawlowicz
Copy link
Collaborator

As mentioned it briefly in #842 the end goal of level 1 optimizations is to operate in whitelist-mode not blacklist-mode as it's done now.

We currently have a compactable object defining how properties behave in level-2 optimizations. The plan is to make it more universal so it can also hold info on how to optimize properties, e.g.

var compactable = {
  'width': {
    canOverride: canOverride.generic.unit,
    defaultValue: 'auto',
    optimize: [
      optimize.pixelLengths,
      optimize.precision,
      optimize.units,
      optimize.zeroUnits
    ],
    shortestValue: '0'
  }
};

This way it'd be easier to:

  • understand what's going on in level 1 optimizations;
  • add extra optimizations on per-property basis;
  • pinpoint issues if anything goes wrong as currently all optimizations are applied to each and every property;
  • write optimization code;

There are some drawbacks too:

  • it won't be easy to optimize multi-value or shorthand properties, e.g. text-shadow or background respectively, without breaking them down to components, optimizing, and then restoring, which is currently a part of level 2 optimizations;
  • it's gonna be verbose but I actually prefer less magic.
@jakubpawlowicz jakubpawlowicz added this to the ~future~ milestone Feb 9, 2017
jakubpawlowicz added a commit that referenced this issue Feb 9, 2017
Why:

* Browsers don't get it right when without quotes;
* it'll all be better with whitelist based optimizations, see #889.
jakubpawlowicz added a commit that referenced this issue Feb 9, 2017
Why:

* Browsers don't get it right when without quotes;
* it'll all be better with whitelist based optimizations, see #889.
jakubpawlowicz added a commit that referenced this issue Feb 10, 2017
Why:

* Browsers don't get it right when without quotes;
* it'll all be better with whitelist based optimizations, see #889.
jakubpawlowicz added a commit that referenced this issue Mar 25, 2017
Why:

* The level 1 optimizations were just a temporary fix until shorthand
  optimizer gets implemented;
* this creates a regression in optimizing `font-weight` inside `font`
  shorthand, which is pending #889.
jakubpawlowicz added a commit that referenced this issue Mar 25, 2017
Why:

* The level 1 optimizations were just a temporary fix until shorthand
  optimizer gets implemented;
* this creates a regression in optimizing `font-weight` inside `font`
  shorthand, which is pending #889.
jakubpawlowicz added a commit that referenced this issue Mar 29, 2017
Why:

* The level 1 optimizations were just a temporary fix until shorthand
  optimizer gets implemented;
* this creates a regression in optimizing `font-weight` inside `font`
  shorthand, which is pending #889.
jakubpawlowicz added a commit that referenced this issue Apr 6, 2017
Why:

* The level 1 optimizations were just a temporary fix until shorthand
  optimizer gets implemented;
* this creates a regression in optimizing `font-weight` inside `font`
  shorthand, which is pending #889.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant