near / react-on-chain

Improved execution layer for NEAR decentralized frontend components
https://roc-docs.near.dev/
23 stars 5 forks source link

feat: Preact versioning #393

Closed andy-haynes closed 1 month ago

andy-haynes commented 1 month ago

This PR updates the way Preact dependencies are imported and specified for third-party packages. In particular:

This fixes #323 and unblocks progress on importing other libraries (tested with @chakra-ui so far), though the latter still needs some work.

vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
bos-web-engine ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 0:03am
bos-web-engine-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 0:03am
bos-web-engine-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 0:03am
andy-haynes commented 1 month ago

While this does fix the issue in #323, it requires specifying version 10.20.1 which does not play nice with @chakra-ui. There are still some things to uncover, but I'm starting to think we won't have a nice way to import arbitrary dependencies without being able to exercise more control over how dependencies are built.

mpeterdev commented 1 month ago

Phosphor icons do not appear to work on this branch even with the full path specifier. Is that expected?

andy-haynes commented 1 month ago

Phosphor icons do not appear to work on this branch even with the full path specifier. Is that expected?

It's broken in production since @phosphor-icons/react@2.1.4 was published. 2.1.4 is not compatible with any Preact version I've tried, 2.0.15 is the last working I know of.

However there's a bug with specifying a version with subpaths, i.e. it should be specified as @phosphor-icons/react@2.0.15/dist/icons/Horse but that ends up pulling everything down 😑

I'll create an issue for the subpath versioning and fix the Component in that PR.