Skip to content

Improve procedural API for all color spaces use case, rel #661 - #663

Merged
LeaVerou merged 1 commit into
mainfrom
spaces-all
Aug 6, 2025
Merged

LeaVerou merged 1 commit into
mainfrom
spaces-all

Conversation

@LeaVerou

@LeaVerou LeaVerou commented Aug 6, 2025

Copy link
Copy Markdown
Member
  • Single export for all color spaces in /fn so they can be registered in one go
  • /spaces export that exports all color spaces and automatically registers them
  • /src export as a catch-all because we are bound to have missed more things

Doesn't close #661, but addresses the most pressing pain point.

- Single export for all color spaces in `/fn` so they can be registered in one go
- `/spaces` export that exports all color spaces and automatically registers them
- `/src` export as a catch-all because we are bound to have missed more things
@netlify

netlify Bot commented Aug 6, 2025 •

Copy link
Copy Markdown

βœ… Deploy Preview for colorjs ready!

Name Link
πŸ”¨ Latest commit 11ce2c2
πŸ” Latest deploy log https://app.netlify.com/projects/colorjs/deploys/6893730278f73e0008e136da
😎 Deploy Preview https://deploy-preview-663--colorjs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LeaVerou LeaVerou added the API change For PRs that require API design review label Aug 6, 2025
@LeaVerou
LeaVerou merged commit e70420e into main Aug 6, 2025
@LeaVerou
LeaVerou deleted the spaces-all branch August 6, 2025 17:44
@lloydk

lloydk commented Aug 6, 2025

Copy link
Copy Markdown
Collaborator

I tried importing something from src in a Typescript project and the type for the function couldn't be found.

import { toPrecision } from "colorjs.io/src/util.js";

results in this error:

Could not find a declaration file for module 'colorjs.io/src/util.js ...'

Not sure what needs to be added to package.json so that types are picked up for the ./src/* export.

@LeaVerou

LeaVerou commented Aug 6, 2025

Copy link
Copy Markdown
Member Author

I tried importing something from src in a Typescript project and the type for the function couldn't be found.

import { toPrecision } from "colorjs.io/src/util.js";

results in this error:

Could not find a declaration file for module 'colorjs.io/src/util.js ...'

Not sure what needs to be added to package.json so that types are picked up for the ./src/* export.

Can you file an issue so we're not tracking this in a merged PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API change For PRs that require API design review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using the procedural API + importing all color spaces is painful

3 participants