Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork578
Publish an isomorphic plug-n-play react component using Tamagui#507
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Based on the docs, it seems that actually consuming components created with tamagui on the web requires adding a loader in order to compile it in order to get the performance benefits. However, for people wanting to publish for example, a React UI library as an npm package using Tamagui, it would be unexpected to have to have consumers add a loader in order to use it. In other words, I would not want to have in the docs of my package something like "Step 1: add this tamagui loader to your webpack" or something like that. I'm wondering if this is something that's been considered and if there are any plans for this. To me it seems that the compiler can theoretically be run as a build script by the package maintainer, such that the following is possible: In web code: import{Thing}from'mypackage/web'; In native code: import{Thing}from'mypackage'; In my head I imagine that when publishing the package, I would run the tamagui compiler which would output some files to something like Does this make sense? Is this already possible and I'm just missing how to do it? |
BetaWas this translation helpful?Give feedback.
All reactions
You can just publish a component that depends on@tamagui/core. I think if you want to promote the extra performance you'd have to mention there's an optional compiler, that's just the deal. But it wouldn't be mandatory, everything works at runtime.
Replies: 2 comments
-
You can just publish a component that depends on |
BetaWas this translation helpful?Give feedback.
All reactions
-
does this mean that one could not publish a component that depends on tamagui components? or if so what is the way to do so to avoid tamagui config issues. |
BetaWas this translation helpful?Give feedback.