About plugin naming/scoping for new features #78
Replies: 3 comments
-
I think it all comes down to specs. If we go the route of I know this probably won't help but I'm keen either way. On one hand, I tend to go for a smaller, single-purpose package/function always. On the other hand though, if they're going to share a bunch of logic it'd make sense to group them and/or extract them into another smaller package that abstracts that up. It could also make sense to have a plugin pack for color-4. I guess it comes down how specific the code is between |
Beta Was this translation helpful? Give feedback.
-
Good to hear that you do not have any immediate concerns in creating more small packages :) Specifically for
I would have to prototype this and check how much hassle different configurations are. Smaller packages are definitely simpler from an But in Also need to figure out a way to easily check the feature name in caniuse-lite. |
Beta Was this translation helpful? Give feedback.
-
Plugin scoping is defined by how features are grouped (or not) in MDN and caniuse data. So for future plugins we simply need to lookup how the feature is mapped in MDN/caniuse and follow there lead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
see : #70
I would really like to add full support for css-color-4 and css-color-5 (depending on spec status).
Had some thoughts and questions and want to make the right compromise.
Context :
lab(...)
andlch(...)
rgb(0 0 0)
->rgb(0, 0, 0)
Things I think are important :
preset-env
should easily understand the scope of a plugin by the name.Specific example
This makes it non-trivial to decide on where to add features like :
hwb(...)
hsl(...)
oklab(...)
oklch(...)
Overloading
postcss-lab-function
even more is possible but would make it harder for users to know what the package does.Alternatively a new package could cover all css color functions and include the functionality of
postcss-lab-function
as a dependency? (might conflict with current workspaces setup, need to test this)Any thoughts or ideas here?
What I observe in current package naming/scoping
Some packages are really tiny (
rebeccapurple
) and others are a collection of transforms (logical
)Personally I lean towards creating only larger packages that don't focus on a single transform.
They can still start small but have a predefined larger scope.
This would make it easier to add new transforms in an existing package.
postcss-lab-function
postcss-color-functions
New functions like
oklab
would still fit the larger scope defined forpostcss-color-functions
Regularly regrouping and naming the biggest hurdles / largest chores is important here.
More packages means more work and the mono repo helps a lot, but it doesn't solve every maintenance challenge.
If we often point out what is holding is back in some area's we can start thinking of ways to improve.
I also want to avoid getting slowed down by naming things.
Which is something I now experience :)
Not having a natural place to add
hwb
andhsl
is a bigger hurdle than writing the actual transform.Having good guidelines would help :)
Beta Was this translation helpful? Give feedback.
All reactions