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

Release 14.0.0 #5205

Closed
28 of 30 tasks
jeddy3 opened this issue Mar 21, 2021 · 54 comments
Closed
28 of 30 tasks

Release 14.0.0 #5205

jeddy3 opened this issue Mar 21, 2021 · 54 comments
Labels
status: wip is being worked on by someone type: umbrella a group of related issues

Comments

@jeddy3
Copy link
Member

jeddy3 commented Mar 21, 2021

Our work to be done:

I believe these are the steps to releasing a version without any security warnings.

Non-blocking work we or the community needs to do:

Non-breaking nice-to-haves:

Non-blocking limitations:


Release:

Node 10 EOL is at the end of April. A lot of the packages we depend on will shift to Node 12 (and ESM) around then (see #5198 and sindresorhus/meta#15)

It'll be a major release of stylelint, so it's an opportunity to roll in other breaking changes. If you've got an itch to scratch that's a breaking change, then this is the time to do it!

We should remove deprecated code, e.g. #4899 and all the deprecated rules.

@ybiquitous
Copy link
Member

If we can use dynamic imports, import-lazy may be needless:

"import-lazy": "^4.0.0",

@jeddy3
Copy link
Member Author

jeddy3 commented Apr 11, 2021

Does node@12 supports dynamic imports? If so, that'll be great as we are reliant lazy/dynamic loading for performance.

@ybiquitous
Copy link
Member

ybiquitous commented Apr 11, 2021

Oh, I missed that the --experimental-modules flag is necessary for Node 12, sorry 😓

image

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility


Updated image:

image

@m-allanson
Copy link
Member

m-allanson commented Apr 12, 2021

I think the LTS release of node 12 supports ESM without a flag. See:

Screenshot 2021-04-12 at 08 46 35

@hudochenkov
Copy link
Member

@m-allanson I think we talk about import().then(), not regular import.

@jeddy3
Copy link
Member Author

jeddy3 commented Apr 12, 2021

Oh, I missed that the --experimental-modules flag is necessary for Node 12, sorry

Perhaps ESM (non-dynamic) with bundling will be our approach for 14.0.0. It'll give us:

  • something that's future-facing (for dynamic ESM down the line)
  • compatibility with our dependencies which will be shifting to ESM
  • a non-performant version that can be installed directly from GitHub and tested against
  • a performant version published to NPM with a small set of system tests
  • browser compatibility

Steps towards this:

  1. Deprecated and then remove problematic function-calc-no-invalid (Remove function-calc-no-invalid #4731 (comment)).
  2. Investigate if there's a way to refactor the no-vendor prefix rules to avoid relying on autoprefixer (and the caniuse dataset); prefixes are on their way out in favour of browser flags, and perhaps maintaining a simple list in stylelint of vendor-prefixed properties used today is a simpler viable alternative.
  3. Investigate ESM bundlers and compare their performance, particular ESBuild.
  4. Investigate Jest's native support for ESM (we'll want to avoid transpiling for tests).

@alexander-akait
Copy link
Member

Investigate Jest's native support for ESM (we'll want to avoid transpiling for tests).

Not ready yet, and I think will not ready in near future

@ybiquitous
Copy link
Member

FYI. https://jestjs.io/docs/ecmascript-modules

It seems Jest's mocks do not work with ESM: jestjs/jest#10025

@jeddy3
Copy link
Member Author

jeddy3 commented May 4, 2021

Thoughts on a node 14 minimum in 14.0.0?

We're such a small team of volunteers that I think we may need to jump to a minimum of node 14 if we are to stand a chance of migrating to ESM to maintain compatibility with our dependencies. As a dev tool, I think we can be progressive in the node versions we support.

We'd then be able to use dynamic imports for rules, syntaxes, formatters, plugins and processors, which will hopefully keep things simple and doable. If anyone fancies it, a proof of concept showing dynamic imports working (for just one of these parts) would be ace.

(It'd also be good to know if either method B or C will work with transpiling dynamic imports and Jest.).

@ybiquitous
Copy link
Member

The idea sounds attractive to me. But the one thing that I’m concerned about is that perhaps many people will still be using Node.js 12 until it will be End-Of-Life on 2022-04-30.

For example, the following application will not be able to install stylelint 14:

  • it has "engines": { "node": "12.22.0" } in its package.json
  • and, it has engine-strict = true in its .npmrc

Such applications must continue using stylelint 12 or upgrade to Node.js 14. The task may be hard for some applications... 🤔

There is a more flexible but a bit complex way to use dynamic imports and require Node.js 12 as a minimum. In that case, people using Node.js 12 would have to specify the --experimental-modules flag such as NODE_OPTIONS=--experimental-modules stylelint *.css. We would describe such a workaround and promote users to upgrade to Node.js 14 in the document.

@jaydenseric
Copy link

Why is there a dilemma? With this level of support:

{
  "engines": {
    "node": "^12.20 || >= 14.13"
  }
}

You can use everything to do with ESM in Node.js except top level await, which is available unflagged since v14.8.0:

https://nodejs.org/dist/latest-v16.x/docs/api/esm.html#esm_modules_ecmascript_modules

Conveniently, this is also matches the minimum Node.js versions that support package subpath patterns.

I'm migrating all of my published packages to this level of Node.js support, and so are many other package maintainers (although some are lazy and incorrectly just update engines.node to >=12).

@ybiquitous
Copy link
Member

@jaydenseric Excellent idea! 👏🏼 It should resolve any concerns!

@jeddy3
Copy link
Member Author

jeddy3 commented May 6, 2021

Thanks for clearing that up. I hadn't realised dynamic imports are available in 12.20 without a flag.

I think we're good to proceed with moving to ESM with:

{
  "engines": {
    "node": "^12.20 || >= 14.13"
  }
}

Next steps:

  • investigating dynamic imports
  • investigating using Jest with ESM

If anyone fancies digging in, please do.

@qubyte
Copy link
Contributor

qubyte commented May 7, 2021

One such package which has dropped support for node 10 is meow, which stylelint depends on. Version 9 is afflicted with this advisory in its dependency tree, which is resolved naturally in version 10. Version 10 of meow drops support for node 10 though, so updating to it would mean dropping node 10 support here too.

@jeddy3
Copy link
Member Author

jeddy3 commented May 7, 2021

Thanks.

Meow 10.0.0 release notes and linked ESM migration guide:

How can I move my CommonJS project to ESM?

  • Add "type": "module" to your package.json.
  • Replace "main": "index.js" with "exports": "./index.js" in your package.json.
  • Remove 'use strict'; from all JavaScript files.
  • Replace all require()/module.export with import/export.
  • Use only full relative file paths for imports: import x from '.';import x from './index.js';.
  • If you have a TypeScript type definition (for example, index.d.ts), update it to use ESM imports/exports.
  • Optional but recommended, use the node: protocol for imports.

@jeddy3
Copy link
Member Author

jeddy3 commented May 12, 2021

I'm going to create separate issues for bits in the 14.0.0 release. I'll use this issue as an umbrella, and create an ordered checklist in the top post so that we have a clear set of steps.

@jeddy3 jeddy3 pinned this issue May 12, 2021
@jeddy3 jeddy3 mentioned this issue May 12, 2021
@jeddy3
Copy link
Member Author

jeddy3 commented May 12, 2021

I've created a v14 branch. I'm going to get the ball rolling by removing the deprecated rules (#5290).

@ybiquitous
Copy link
Member

v14.0.0 may be a good chance to rename the main branch from master to main. What do you think?

This was referenced Jan 18, 2022
@Mouvedia
Copy link
Contributor

Mouvedia commented Mar 5, 2022

You forgot #5173. Will it have to wait version 15?

@jeddy3
Copy link
Member Author

jeddy3 commented Mar 6, 2022

You forgot #5173. Will it have to wait version 15?

I can be included in a minor release due to our semver policy:

Might break your lint build: a bug fix in a rule that results in Stylelint reporting more errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: umbrella a group of related issues
Development

No branches or pull requests