Paul
Paul2mo ago

React Library Best Practises

Hi, I'm trying to migrate our app-sdk and app-sdk-react from Node to Deno. The app-sdk went fine without issues and is able to be imported and uesd across Deno and Node/npm worlds without issue. But I'm having issues with React. I don't have react in my dependancies as I use Denos built in support. My compiler options are;
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"jsxImportSourceTypes": "@types/react"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"jsxImportSourceTypes": "@types/react"
},
But I'm unsure if this is the best practise. I don't want to add dependancies and requirements to my project if that limits the consumer - for example they may want to use Preact instead of React. Is there a guide on how to build React Libraries using Deno - and then an extension would be how to export it to npm (I assume using https://github.com/denoland/dnt) I'm really keen to get this right as once the app-sdk and app-sdk-react are migrated to Deno, we intend to migrate the apps to Deno as well and we have 56 of them and growing (they're like client side applets) and they're all open source.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?