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

Use import-lazy for rules #815

Closed
wants to merge 1 commit into from
Closed

Use import-lazy for rules #815

wants to merge 1 commit into from

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented May 2, 2023

C:\Users\xmr\Desktop\stylelint-scss>git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

C:\Users\xmr\Desktop\stylelint-scss>hyperfine "node load-time.js"
Benchmark 1: node load-time.js
  Time (mean ± σ):     174.5 ms ±   3.7 ms    [User: 0.8 ms, System: 2.5 ms]
  Range (min … max):   171.1 ms … 185.3 ms    17 runs

C:\Users\xmr\Desktop\stylelint-scss>git checkout -
Switched to branch 'xmr/import-lazy'

C:\Users\xmr\Desktop\stylelint-scss>hyperfine "node load-time.js"
Benchmark 1: node load-time.js
  Time (mean ± σ):     123.5 ms ±   5.9 ms    [User: 2.5 ms, System: 2.9 ms]
  Range (min … max):   116.4 ms … 140.6 ms    23 runs

load-time.js:

"use strict";

console.log("Load time");
console.time("Module");

exports.m = require(".");

console.timeEnd("Module");

Approximately 28% faster load time on my machine.

@XhmikosR XhmikosR marked this pull request as ready for review May 2, 2023 15:00
@XhmikosR XhmikosR requested a review from kristerkari May 2, 2023 15:00
@XhmikosR XhmikosR mentioned this pull request May 2, 2023
@kristerkari
Copy link
Collaborator

The only doubt that I have is the import-lazy library. Is it safe to use and still maintained (as the last version is from 2019)?

@XhmikosR
Copy link
Member Author

XhmikosR commented Jun 8, 2023

The dep is OK, it's just that people move to ESM so there's no need to update it. Stylelint itself is using the same dep for the same reason.

@ybiquitous
Copy link
Contributor

FYI. Stylelint has replaced import-lazy with dynamic import() (stylelint/stylelint@aa9be6f). This commit will be included in the next major version 16.0.0.

nix6839 added a commit to nix6839/stylelint-scss that referenced this pull request Dec 14, 2023
nix6839 added a commit to nix6839/stylelint-scss that referenced this pull request Dec 14, 2023
nix6839 added a commit to nix6839/stylelint-scss that referenced this pull request Dec 18, 2023
nix6839 added a commit to nix6839/stylelint-scss that referenced this pull request Dec 26, 2023
nix6839 added a commit to nix6839/stylelint-scss that referenced this pull request Jan 28, 2024
@XhmikosR XhmikosR closed this Feb 2, 2024
@XhmikosR XhmikosR deleted the xmr/import-lazy branch February 2, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants