Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

7.0.0 #174

Closed
wants to merge 7 commits into from
Closed

7.0.0 #174

wants to merge 7 commits into from

Conversation

jonathantneal
Copy link
Collaborator

@jonathantneal jonathantneal commented Apr 25, 2020

Changes to PostCSS Preset Env

7.0.0 (April 25, 2020)

  • Updated autoprefixer to 9.7.6 (minor)
  • Updated browserslist to 4.12.0 (minor)
  • Updated caniuse-lite to 1.0.30001046 (patch)
  • Updated css-blank-pseudo to 1.0.0 (major)
  • Updated css-has-pseudo to 1.0.0 (major)
  • Updated css-prefers-color-scheme to 4.0.0 (major)
  • Updated cssdb to 5.0.0 (major)
  • Updated postcss to 7.0.27 (patch)
  • Updated postcss-attribute-case-insensitive to 4.0.2 (patch)
  • Updated postcss-color-functional-notation to 3.0.0 (major)
  • Updated postcss-color-rebeccapurple to 5.0.0 (major)
  • Updated postcss-custom-properties to 9.1.1 (major)
  • Updated postcss-double-position-gradients to 2.0.0 (major)
  • Updated postcss-env-function to 3.0.0 (major)
  • Updated postcss-focus-visible to 5.0.0 (major)
  • Updated postcss-focus-within to 4.0.0 (major)
  • Updated postcss-initial to 3.0.2 (patch)
  • Updated postcss-lab-function to 3.1.0 (major)
  • Updated postcss-logical to 4.0.2 (major)
  • Updated postcss-nesting to 7.0.1 (patch)
  • Updated postcss-place to 5.0.0 (major)
  • Updated support for Node 10+ (major)

Remaining Work

Update PostCSS Values Parser from v2 to v3

@jonathantneal jonathantneal force-pushed the next/release branch 6 times, most recently from 6a1cb74 to 85e0379 Compare April 28, 2020 11:00
@BridgeAR
Copy link
Contributor

BridgeAR commented Jun 4, 2020

@jonathantneal do you have an estimate for this? We are eagerly waiting for the updated presets 😄

@Semigradsky
Copy link
Member

Semigradsky commented Jun 11, 2020

How about to add some new plugins in this release?
#158 #176 #181 #189

@equinusocio
Copy link

@jonathantneal I don't see the :is (currently :matches) plugin. It will be removed?

@Antonio-Laguna
Copy link
Member

Is this still intended? I'm having a lot of issues upgrading to next postcss but not 100% sure they're related to this being missing.

@lwyj123
Copy link

lwyj123 commented Dec 28, 2020

is there any progress on the 7.0.0 version ?

@felipeqq2
Copy link

I'm not seeing any progress in this PR, but it would be great to upgrade postcss to 8.2.10, solving #207.

@jkevingutierrez
Copy link

Is there anything that we can help to have this PR merged?

@Antonio-Laguna
Copy link
Member

@simonjoom I'm fairly close to have all tests passing. Will be ready soon on a PR

@simonjoom
Copy link

simonjoom commented Sep 25, 2021

@simonjoom I'm fairly close to have all tests passing. Will be ready soon on a PR

Finally I updated the code to be compatible 100% with postcss8


var postcss2 = function (opts) {
 const features = Object(Object(opts).features);
  const insertBefore = Object(Object(opts).insertBefore);
  const insertAfter = Object(Object(opts).insertAfter);
  const browsers = Object(opts).browsers;
  const stage = 'stage' in Object(opts) ? opts.stage === false ? 5 : parseInt(opts.stage) || 0 : 2;
  const autoprefixerOptions = Object(opts).autoprefixer;
  const sharedOpts = initializeSharedOpts(Object(opts));
  const stagedAutoprefixer = autoprefixerOptions === false ? () => {} : autoprefixer__default["default"](Object.assign({
    overrideBrowserslist: browsers
  }, autoprefixerOptions)); // polyfillable features (those with an available postcss plugin)

  const polyfillableFeatures = cssdb__default["default"].concat( // additional features to be inserted before cssdb features
  getTransformedInsertions(insertBefore, 'insertBefore'), // additional features to be inserted after cssdb features
  getTransformedInsertions(insertAfter, 'insertAfter')).filter( // inserted features or features with an available postcss plugin
  feature => feature.insertBefore || feature.id in plugins).sort( // features sorted by execution order and then insertion order
  (a, b) => idsByExecutionOrder.indexOf(a.id) - idsByExecutionOrder.indexOf(b.id) || (a.insertBefore ? -1 : b.insertBefore ? 1 : 0) || (a.insertAfter ? 1 : b.insertAfter ? -1 : 0)).map( // polyfillable features as an object
  feature => {
    // target browsers for the polyfill
    const unsupportedBrowsers = getUnsupportedBrowsersByFeature(feature.caniuse);
    return feature.insertBefore || feature.insertAfter ? {
      browsers: unsupportedBrowsers,
      plugin: feature.plugin,
      id: `${feature.insertBefore ? 'before' : 'after'}-${feature.id}`,
      stage: 6
    } : {
      browsers: unsupportedBrowsers,
      plugin: plugins[feature.id],
      id: feature.id,
      stage: feature.stage
    };
  }); // staged features (those at or above the selected stage)

  const stagedFeatures = polyfillableFeatures.filter(feature => feature.id in features ? features[feature.id] : feature.stage >= stage).map(feature => ({
    browsers: feature.browsers,
    plugin: typeof feature.plugin.process === 'function' ? features[feature.id] === true ? sharedOpts // if the plugin is enabled and has shared options
    ? feature.plugin(Object.assign({}, sharedOpts)) // otherwise, if the plugin is enabled
    : feature.plugin() : sharedOpts // if the plugin has shared options and individual options
    ? feature.plugin(Object.assign({}, sharedOpts, features[feature.id])) // if the plugin has individual options
    : feature.plugin(Object.assign({}, features[feature.id])) // if the plugin is already initialized
    : feature.plugin,
    id: feature.id
  })); // browsers supported by the configuration

  const supportedBrowsers = browserslist__default["default"](browsers, {
    ignoreUnknownVersions: true
  }); // features supported by the stage and browsers

  const supportedFeatures = stagedFeatures.filter(feature => feature.id in features ? features[feature.id] : supportedBrowsers.some(supportedBrowser => browserslist__default["default"](feature.browsers, {
    ignoreUnknownVersions: true
  }).some(polyfillBrowser => polyfillBrowser === supportedBrowser)))
 
//relevant code below here::
const polyfills =supportedFeatures.map(a=>a.plugin); 
    const Featureids =supportedFeatures.map(a=>a.id);
    console.log(Featureids); 
   return {
  ...postcss__default["default"]([
     ...polyfills,
    stagedAutoprefixer
  ]),
     postcssPlugin: 'postcss-preset-env'
   }
 }


module.exports = postcss2;
module.exports.postcss = true

if you do not change code of postcss-preset-env like I did, it is not working for me.

But I found an issue with double-position-gradients with my css (compilation seems to loop or very slow;..) , in my case I disabled this plugin in code

@Antonio-Laguna
Copy link
Member

There other things that need updating and some other bugs unearthed with this. Such as the font system ui plug-in for example

@Antonio-Laguna Antonio-Laguna mentioned this pull request Sep 25, 2021
@simonjoom
Copy link

simonjoom commented Sep 26, 2021

thanks for the release,
I updated my code, well seems cleaner
about postcss-initial , the last release with postcss8 is 4.0 , if you let ^3 in package.json it's not installing the last version

I need still to disable double-position-gradients else the project not building

* Updating as per plugin spec

See postcss/postcss-font-variant#15

* Adding all property back

* Updating System UI plugin to be compatible with PostCSS 8

* Removing no longer existing property

* Autoprefixer false doesn't mess with the rest of the file

* Updating with up to spec from image set plugin

* Using last mod since color-mod was rejected and no longer within pack

* Updating main file to be up to PostCSS 8
@jonathantneal
Copy link
Collaborator Author

Superseded by #214

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants