Skip to content

Conversation

@aquapi
Copy link

@aquapi aquapi commented Mar 24, 2025

Replaced p-limit with ciorent in the astro package

Changes

Replace p-limit and some p-queue usage with ciorent/semaphore for better bundle size (and possibly performance).

Sizes: p-limit, ciorent

  • Install size: 18kB -> 15kB
  • Bundle size: 1.3kB -> 575B

Testing

I'm not sure how to test these changes so I run every test with pnpm run test.
These failed tests don't seem to relate to the changes I made.

astro:test:  failing tests:
astro:test:
astro:test: test at test/cli.test.js:83:2
astro:test:  astro info (928.695098ms)
astro:test:   AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
astro:test:
astro:test:     assert.ok(clipboardContent.includes(`v${pkgVersion}`))
astro:test:
astro:test:       at TestContext.<anonymous> (file:///.../astro/packages/astro/test/cli.test.js:99:11)
astro:test:       at async Test.run (node:internal/test_runner/test:932:9)
astro:test:       at async Suite.processPendingSubtests (node:internal/test_runner/test:629:7) {
astro:test:     generatedMessage: true,
astro:test:     code: 'ERR_ASSERTION',
astro:test:     actual: false,
astro:test:     expected: true,
astro:test:     operator: '=='
astro:test:   }
astro:test:
astro:test: test at test/custom-404-implicit-rerouting.test.js:30:4
astro:test:  dev server handles normal requests (1005.870977ms)
astro:test:   'test timed out after 1000ms'
astro:test:
astro:test: test at test/custom-404-implicit-rerouting.test.js:30:4
astro:test:  dev server handles normal requests (1003.06281ms)
astro:test:   'test timed out after 1000ms'
astro:test:
astro:test: test at node_modules/.astro/test.mjs:1:1
astro:test:  /.../astro/packages/astro/node_modules/.astro/test.mjs (600002.22518ms)
astro:test:   'test timed out after 600000ms'
astro:test:  ELIFECYCLECommand failed with exit code 1.
astro:test:  ELIFECYCLETest failed. See above for more details.
astro:test: ERROR: command finished with error: command (/.../astro/packages/astro) /.../.nvm/versions/node/v23.6.1/bin/pnpm run test exited (1)
astro#test: command (/.../astro/packages/astro) /.../.nvm/versions/node/v23.6.1/bin/pnpm run test exited (1)

Docs

This only changes the implementation details of some internal functions.

@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2025

⚠️ No Changeset found

Latest commit: 78d4ad0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 24, 2025
@ematipico
Copy link
Member

Thank you for the suggestion, but we're happy with p-limit. Feel free to open a discussion on Discord and engage with us

@ematipico ematipico closed this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants