Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a minimal React + SWC sample #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pklaschka
Copy link

This is a minimal, bare-bones boilerplate for creating UXP plugins with React, which also includes usage of Spectrum Web Components in a theme-aware way.

It focuses on providing a minimal setup that allows you to get started with React and UXP as quickly as possible.

Note that conveniences such as automatic reloading using UDT are not included in this boilerplate. If you want to use
them, you'll have to set them up yourself.

Yes, I've signed the CLA.

@bhatiaPankaj
Copy link
Contributor

@pklaschka
We have a starter plugin in React context available already here.
This one uses the recommended swc-react library.

@pklaschka
Copy link
Author

pklaschka commented Oct 14, 2023

Fair enough about the swc-react library. But I will note that it's a bit ironic (I know the internal/external development processes at play here, so no hard feelings; I just want to point it out for context) to say that a sample "already" exists when it (according to the commit history) got added 8 days ago and this PR has been waiting for review for 2 months by now 😉.

I will also point out that

  • my sample makes the SWCs theme-aware, which the current sample doesn't, as far as I can see.
  • my sample includes importing an image, which at least initially was broken with the provided React starter package. I'm not sure if this still affects the now-official sample (I'm not at home at the moment so can't test it), but if so, I think it's important to change that since importing images in React is quite common.

I will look into how to continue with this (whether I rewrite the PR to integrate the features mentioned above into the new sample or something else) when I get home.

@bhatiaPankaj
Copy link
Contributor

Regarding the use of "already," it's worth noting that the commit history here is misleading as this plugin was taken (in addition to supported apps entry in manifest.json) from PS samples repo which was posted well before 2 months back though remained under review. ps-samples-commit-history-link
In fact, the starter plugin using the swc-react library has indeed been available in our corp repo for quite some time.
We had been waiting for a stable and verified swc-react library and a compatible swc-uxp-wrappers to publish on public repo.

Concerning the theme-awareness and image import issues, I agree that these are important considerations. Please take a look at whether these issues persist in the new sample, and we can discuss the best approach for addressing them, whether that means integrating them into the current plugin or creating a separate solution.

@padmkris123
Copy link
Collaborator

@pklaschka Apologies for keeping your PR hanging for weeks. We were actively working on a sample plugin for React and upgrading the wrapper approach, and in the process, your PR got missed. I love the theme awareness and image import feature in your plugin! Definitely worth adding to our sample code. Have you already played with the newly added starter plugins?

1 similar comment
@padmkris123
Copy link
Collaborator

@pklaschka Apologies for keeping your PR hanging for weeks. We were actively working on a sample plugin for React and upgrading the wrapper approach, and in the process, your PR got missed. I love the theme awareness and image import feature in your plugin! Definitely worth adding to our sample code. Have you already played with the newly added starter plugins?

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.

None yet

3 participants