AdobeDocs / uxp-indesign-samples

MIT License
14 stars 9 forks source link

Add a minimal React + SWC sample #4

Open pklaschka opened 1 year ago

pklaschka commented 1 year ago

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 commented 1 year ago

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

pklaschka commented 1 year ago

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

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 commented 1 year ago

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 commented 1 year ago

@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?

padmkris123 commented 1 year ago

@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?