Chat about the future for stitches #1149
Replies: 68 comments 83 replies
-
I'm a passionate stitches user/believer/supporter, and would love to help however I can. That said, I'm more of a designer than a OSS maintainer so I'm not sure how I could. I work as a manager so maybe have skills to contribute around planning etc. Are there any peeps with OSS maintenance experience? |
Beta Was this translation helpful? Give feedback.
-
I know https://github.com/Mokshit06 has been working on a project called macaron which is very similar to this stitches static extraction endeavor. I wonder if there's any desire to combine efforts here? I can also say that I'm happy to take PRs on where I can. |
Beta Was this translation helpful? Give feedback.
-
Macaron is built off of vanilla-extract so they would need to be included in that conversation since it’s their static extraction engine. |
Beta Was this translation helpful? Give feedback.
-
This is really good news 🎉 While I don't have the capacity right now to maintain Stitches again, I'd love to help out with the DX-related work, including the Stitches API. Being one of its creator, I can also contribute to providing historic context where necessary. If there's a future for Stitches, I'd also love to once again advocate for it. |
Beta Was this translation helpful? Give feedback.
-
I gave a try to macaron but it lacks many Stitches features yet, the api is the same which is nice but the types and access to the tokens is still missing, same for responsive variants. I think it's a great start point since Stitches runtime will have to be replaced. I'm wondering if it worth relying on an external tool or better to build it internally. We use it internally in Miro's design system, and I could absolutely step in to push Stitches forward! |
Beta Was this translation helpful? Give feedback.
-
I've recently been writing a POC for a stitches like api with static extraction. Bit of a frankenstein, but it's alive!!! Works more or less like this: I wrote something like cva, then using linaria to create the classes and handle css extraction. Now, linaria has an option that let's you define a preprocessor, using stylis we can add a plugin that adds all the nice stitches stuff like utils, custom theme map, etc, and since this is a build step, stylis is never included in the browser bundle. And by the way, let me take a moment just to mention how great stylis is, like really. The real challenge was actually to get responsive variants to work. The best solution i could come up with was to create a new option named dynamic variants, the goal is to use them to set css variables. The problem with css variables is that it bleeds to child elements, so using React's Just throwing some ideas out there, feel free to use and adapt if needs be. A sample of how it looks like at the moment: import { css } from "@linaria/core"
const Stack = styled("div", {
base: css`
display: flex;
flex-direction: var(--stack-direction, column);
& > :not(style) ~ :not(style) {
margin-top: var(--stack-spacing-column, 0);
margin-inline: var(--stack-spacing-row, 0) 0;
margin-bottom: 0;
}
`,
dynamicVariants: {
spacing: (v: number) => ({ "--stack-spacing": `calc(${v} * 1px)` }),
direction: (v: "row" | "column") => ({
"--stack-spacing-row": v === "row" ? "var(--stack-spacing)" : "initial",
"--stack-spacing-column": v === "column" ? "var(--stack-spacing)" : "initial",
"--stack-direction": v,
}),
},
defaultVariants: {
spacing: 16,
direction: "column",
},
}) I've never wrote a babel or SWC plugin, so my experience with it is not up to par to the needs of stitches. But I'll definitely contribute with a pull request here and there. @gajus and his company @contra have voiced interest in this here, and I would support them. I've used another package by him (them?) and was really please with it. |
Beta Was this translation helpful? Give feedback.
-
I had a conversation about it with @StephenHaney, and unfortunately it is no longer an option for me or Contra to become active maintainers of Stitches. We also intentionally do not use SSR (or intend to), so the static extraction is not particularly relevant to our setup. |
Beta Was this translation helpful? Give feedback.
-
A shame, but totally understandable nonetheless. 👍 |
Beta Was this translation helpful? Give feedback.
-
Hey :) I used I would happily share my insights on the usage and help in achieving the static extraction engine! Thank you so much for Stitches by the way, it is an amazing project and I hope it continues to make styling so pleasing for everyone! |
Beta Was this translation helpful? Give feedback.
-
I've not a great experience in this type of library, but I do have experience in large OSS projects - primarily react-spring but also react-three-fiber / drei & strapi (who I work for). I've always loved stitches from when I first used it, I use it for my own site and the react-spring docs site and at my previous work used it on several microsites. I'd be happy to help out with daily triaging and working on smaller features and fixes till I'm up to speed on the landscape of styling solution - I'd understand if I don't quite fit the bill though 💪🏼 |
Beta Was this translation helpful? Give feedback.
-
I don't think I have the capacity to be a lead maintainer, but I'd love to contribute and work with an ad hoc group in the interim. If it feels like there is sufficient energy, maybe it would b worth figuring out a little meetup to get some historical context via @peduarte and start roadmapping? |
Beta Was this translation helpful? Give feedback.
-
On the one hand, I am sad to hear that the original team cannot maintain the project anymore, but on the other hand, I am excited to see that the project might have a strong future since also at our team, we decided against adopting using Stitches for our latest product despite this being our favorite styling library. I am a big fan of Stitches API design and strongly believe this could become the go-to alternative to styled-components for every project that wants to adopt react 18+. I would be excited to start maintaining the library together with the team at Commonbase, but I would need to have a quick discussion with the team first to see whether we have the bandwidth in the near future to rewrite the style extraction logic. |
Beta Was this translation helpful? Give feedback.
-
Same boat as a lot of people here, love stitches, been using it for quite some time now (since the @christianalfoni experimentation days) and I do have some thoughts on how to keep pushing forward the APIs. But As lot of people, don't have the bandwidth to take on a maintainer role (and it wouldn't help the library to be sometimes available). |
Beta Was this translation helpful? Give feedback.
-
Not to spam but I'd be happy to help Tamagui cover any gaps people see in using it, as currently it's probably the closest to Stitches in terms of API that has a production-ready static extractor (and optimizer!). I just put out |
Beta Was this translation helpful? Give feedback.
-
@StephenHaney I am the co-author of styled-jsx, if anybody is willing to fund these efforts I could help |
Beta Was this translation helpful? Give feedback.
-
Hello Stitches team and fellow collaborators. Since the formal announcement of Stitches being wound down, I (on behalf of the MUI team) started looking into how Stitches can be used as a build time solution with very minimal runtime code. I had already worked with Linaria before and I knew how it works and how it can facilitate using any kind of runtime CSS-in-JS solution to be moved to build-time. So I took that task and within 3 days (and few more for some refinement) I was able to create a POC using Linaria for the build-time evaluation and Stitches as the actual CSS-in-JS library. I call this library First Change -import {theme} from './path-to-local/stitches.config';
const component = styled('div', {
color: 'red',
backgroundColor: theme.colors.background.value
}) Here, you can import and use your generated const component = styled('div', ({ theme }) => ({
color: 'red',
backgroundColor: theme.colors.background.value
})) Intead of importing, you are passed the theme object as an argument. How is this theme generated you ask. So now, stitches config has moved to being passed through build-time configuration. In case of Second Change -The other major portion that is not easy to port to build-time is the inline <Component
css={
count % 2 === 0 ? icss({
color: 'red'
}) : icss({
color: 'blue'
})
}
/> If you want the <Component css={count % 2 === 0 ? "class-1" : "class-2"} /> .class-1 {
color: red;
}
.class-2 {
color: blue;
} All of this uses the last released version of Stitches and only uses the public Stitches API without any kind of modifications. There is slight modification in the final css that is generated but that is done outside of Stitches. Why
Links -
|
Beta Was this translation helpful? Give feedback.
-
Personally very sad to see Stitches get left behind as a result of where the broader React ecosystem is going. For the projects I'm currently working on that use Stitches, I personally get no benefit from RSC / SSR and don't have a need for static extraction. Stitches is great for me as-is, but I'd love to see some improvements around small stuff like supporting container queries, deterministic style ordering etc. Is there a path forward where work on Stitches is limited to improvements on what it's already good at, and out of scope improvements that would require a significant rework of the styling engine are rejected as out of scope?
I haven't been a contributor to Stitches in the past, but I really enjoy using it and would be happy to help in grooming the issue queue to keep it to a limited scope of improvements, and review existing PRs and make contributions just to keep it up to date with basic CSS features. I've been somewhat active in the Discord where I assumed these conversations would take place, but it looks like that all happened somewhere else. Not sure if this reduced scope vision aligns with anyone else, but maybe that would make it less daunting of a project to maintain. |
Beta Was this translation helpful? Give feedback.
-
I can definitely contribute with manpower to make Stitches thrive. Let me know! |
Beta Was this translation helpful? Give feedback.
-
@thiagoarantes @hennessyevan @wbobeirne @StephenHaney |
Beta Was this translation helpful? Give feedback.
-
Please make stitches alive again to save me from tailwind 😬 |
Beta Was this translation helpful? Give feedback.
-
@StephenHaney would it be possible for you to open up this repo for commit access by people here who've expressed interest in moving it forward, and just let them work on it? I see some interesting and concrete developments by @brijeshb42 for example, but I doubt initiatives like that will gain any reasonable traction as a fork. Even if Stitches has a runtime and despite the whims of the React team, there are plenty of people who'd probably benefit from further development, regardless of direction. If you're not going to be stewards then consider just handing it over to anyone saying they're willing to work on it. What's the worst that could happen? This is version controlled software, after all. |
Beta Was this translation helpful? Give feedback.
-
I have been in the ThemeUI ecosystem this whole time, specifically Dripsy because I can cross compile to React Native which is massive win for me. Wondering if this same issue applies to ThemeUI wrt static extraction. I have no issues about rewinding shorthand's from I suppose I could just never use RSC's if ThemeUI isn't static. There will be way more CSS written for sure. |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry if this came out to be a huge misunderstanding as English is my 2nd language, and I'm not technically a dev so I'm not really familiar with the lingo and where to put a comment :-) While there seems to be no way to do static extraction, I've been using this component as a way to include the CSS to the static website built. import React from "react";
import { styled } from "@/lib/styles/stiches.config";
import { HtmlConst } from "@/lib/consts";
import type { CSS } from "@stitches/react";
import type { PropsWithChildren, ForwardedRef } from "react";
import type { NextNode } from "@/types/next.d";
// * TODO: This is where if somehow, in the future,
// * if stitches.dev work more on Static Extraction,
// * then we might consider changing this.
type StyleProps = PropsWithChildren<{
// Default style
style?: CSS,
// CSS overwrite!
css?: CSS,
// Inline style to children
as?: NextNode,
// Customize element name
elementName?: typeof HtmlConst[keyof (typeof HtmlConst)],
// Other props
[x: string]: any,
}>;
const StyleWithRef = ({
style={},
children,
elementName=HtmlConst.DIV,
...otherProps
}: StyleProps,
ref: ForwardedRef<HTMLElement>
) => {
// Somehow, wrap an element like this will cause
// serverside rendering to include all CSS styles
// of the generated class during page load in <head/>.
let CSSWrapper = styled(elementName, style);
return (
<CSSWrapper ref={ref} {...otherProps}>
{children}
</CSSWrapper>
)
}
const Style = React.forwardRef<HTMLElement, StyleProps>(StyleWithRef);
export default Style; Usage: // ...
const Footer = ({children, ...otherProps}: FooterProps) => {
return (
<Style style={FooterStyles} {...otherProps}>
{AppConfig.DESCRIPTIONS.FOOTER}
</Style>
)
}
// ... I hope this provide as a workaround to someone who wants to build a static website using Stitches. If you're curious more about this, you can check for more code at: https://github.com/Cryptsu/Cryptsu.github.io, where I generate my static website using this way. If I understand the situation wrong, please just leave me here :-) Thank you. |
Beta Was this translation helpful? Give feedback.
-
Interesting think to implement to use jsx with next 13+: https://nextjs.org/docs/app/building-your-application/styling/css-in-js#configuring-css-in-js-in-app |
Beta Was this translation helpful? Give feedback.
-
I write a css static extract library with stitches like syntax. please take a look. https://github.com/colliejs/colliejs |
Beta Was this translation helpful? Give feedback.
-
Arriving a bit late to the party, I've been utilizing Stitches for production apps for a few years now. For me, this has been the best API and the most dev-friendly experience among CSS-in-JS packages (I was using styled-components before). Despite many inquiries, I couldn't find a clear answer: should we continue using this package or not? I'm on the verge of creating a relatively large UI kit in Stitches as always, but this unresolved discussion led me to explore other alternatives like yamagui, unocss, stylex, and panda CSS. My entire day was spent testing, and the result is that "Stitches" still stands out as the best one. At some point, I attempted to create a basic version on my own, only to realize that I ended up using many Stitches features – essentially, there was too much to replicate. Please, let anyone willing maintain it, so we can continue enjoying this amazing invention :) |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm just a product engineer, but I still believe stitches has the best in class styling API. Where do I start to learn how to write static extraction? |
Beta Was this translation helpful? Give feedback.
-
I developed https://github.com/jujitsustudio/sutairu in a short amount of time, which includes the stitches API (with some updates) and static extraction. There is working proof of concept, although some plugins can be buggy. Feel free to take inspiration or even fork it for yourself! |
Beta Was this translation helpful? Give feedback.
-
After searching for other libraries to replace stitches, I found that there is still nothing that can replace it. |
Beta Was this translation helpful? Give feedback.
-
No promises but I have a working prototype of static extraction + something
close to stitches (a bit more TS strict oriented). Writing documentation at
the moment before pushing.
…On Sat, Apr 20, 2024, 9:25 AM Nghi Nguyen ***@***.***> wrote:
After searching for other libraries to replace stitches, I found that
there is still nothing that can replace it.
—
Reply to this email directly, view it on GitHub
<#1149 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMQUH42XJOPXGRIT5RWCGDY6JUGLAVCNFSM6AAAAAAWFXK27GVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TCNZUGMZTM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Update
We're going to update the Stitches site to say it's no longer maintained so that new folks are aware of the current status. You can read more here.
Original post:
Hey y'all, I wanted to chat with everyone on the best route for the future of Stitches.
Obviously, things have been very slow lately. Here's the situation: most of the team that created Stitches is no longer available to work on it. And with React 18, the ecosystem has changed and made the future for runtime injection pretty murky.
If you're currently using stitches for SPAs, the React 18 changes don't really matter to you and you can continue using stitches without making any changes. But looking forward, the best route for the library – as far as I can tell – is to use static extraction. For stitches, that means a major rewrite of the styling engine.
So, given all of that, I think the right thing to do is to open it up to the community to have a chance to drive it forward. I'm chatting with a few very qualified people who have volunteered to take over the reins on Stitches. I'd love to see a great maintainer emerge who can help with the small features and daily triage and also drive toward the next major version for React 18+.
I'd LOVE to see the Stitches API with a static extraction engine. I think there's a huge opportunity here to be the perfect styling lib in the React ecosystem.
Let me know what you think of this path and if you'd like to nominate or volunteer as a lead maintainer. 🖤
Beta Was this translation helpful? Give feedback.
All reactions