Skip to content

feat: inject minified css in bundle#560

Merged
arielweinberger merged 10 commits into
mainfrom
feat/inject-minified-css-in-bundle
Sep 13, 2024
Merged

feat: inject minified css in bundle#560
arielweinberger merged 10 commits into
mainfrom
feat/inject-minified-css-in-bundle

Conversation

@arielweinberger

@arielweinberger arielweinberger commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

Description

  • removes the need to import styles.css manually
  • empty styles.css included in the build for backwards compatibility
  • uses tsup's injectStyles with postcss to bundle and minify the CSS, then inject it as a style tag
  • currently uses my fork of tsup where I added support for async function in injectStyles (must-have for postcss), a PR from my fork to the main library will follow shortly
  • remove material-ui, and use react-icons for icons (same icons as before)
  • remove unused IncludedFilesPreview component
  • updated docs

How to test this

Check out the preview deployment below.

  • To test the changes of react-ui, head over to /presentation
  • To test the changes of react-textarea, head over to /textarea

@vercel

vercel Bot commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
copilotkit-example-next-openai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 1:03pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 1:03pm

@mme mme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this looks good.

Just some pointers:

  • search the code for "@copilotkit/react-ui/styles.css" and the other css files, I'm pretty sure there are more occurences
  • We should QA usage in different frameworks e.g. remix

@arielweinberger

arielweinberger commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

We should QA usage in different frameworks e.g. remix

I don't think there's anything that could be affected by frameworks:

        if (globalThis.hasOwnProperty("document")) {
          const style = document?.createElement("style");
          style.innerHTML = '${resultCSS}';
          document?.head.appendChild(style);
        }

@arielweinberger arielweinberger merged commit c2963a0 into main Sep 13, 2024
@arielweinberger arielweinberger deleted the feat/inject-minified-css-in-bundle branch September 13, 2024 13:04
arielweinberger added a commit that referenced this pull request Sep 23, 2024
arielweinberger added a commit that referenced this pull request Sep 24, 2024
* Revert "feat: inject minified css in bundle (#560)"

This reverts commit c2963a0.

* fix import

* regenerate package lock
johannhartmann pushed a commit to johannhartmann/CopilotKit that referenced this pull request Oct 31, 2025
* feat: add css injection at build time

* feat(react-textarea): remove unused IncludedFilesPreview component

* fix formatting

* update dependencies

* fix build issues

* feat(docs): remove styles.css import from inline docs

* fix(docs): remove mentioning of importing styles.css

* fix(docs): remove unnecessary line highlighting

* fix line highlighting
johannhartmann pushed a commit to johannhartmann/CopilotKit that referenced this pull request Oct 31, 2025
* Revert "feat: inject minified css in bundle (CopilotKit#560)"

This reverts commit c2963a0.

* fix import

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants