Module Namespacing Support for Packages
See original GitHub issueSummary
When installing a package that uses module namespacing (export * as {moduleName} from './{moduleName}
), Expo’s default configuration throws an error when compiling for web and iOS. This is an important tool for structuring TypeScript code, so I’d expect it to work out of the box.
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS, Web
SDK Version (managed workflow only)
4.5.2
Environment
MacOS, Node v14.15.5.
Reproducible demo or steps to reproduce from a blank project
https://snack.expo.io/kSlfJiSnR
Steps to reproduce:
npm install @dfinity/agent
- Somewhere in the code -
import { HttpAgent } from "@dfinity/agent";
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Packaging namespace packages
Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages (referred to as ...
Read more >Documentation - Namespaces and Modules - TypeScript
This post outlines the various ways to organize your code using modules and namespaces in TypeScript. We'll also go over some advanced topics...
Read more >support namespace packing #167 - python-poetry ... - GitHub
It seems that you are looking for poetry options to control the distribution name independently of the package names. If you have trouble...
Read more >python namespaces vs packages: making a ... - Stack Overflow
Now, because pypackage is a setuptools namespace package you have a different problem; namespace packages are there for multiple separate ...
Read more >Ruby Cookbook: Modules and Namespaces - O'Reilly
A Ruby module is nothing more than a grouping of objects under a single name. The objects may be constants, methods, classes, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah right, that’s the domain-specific stuff. I’ll unignore that folder and push it up for reproduction to spare you from needing to install our SDK. You won’t end up with a fully working example, but the frontend should compile
Yes, that’s also possible! I’m not sure how Snack would react, but we can always find a solution for that later.
main
file as entrypoint (defaults toindex.js
). This could contain plain Common JS code.module
entrypoint. (although this isn’t an “official” spec, it’s still in proposal state). This could contain the ESM code.react-native
entry point. (couldn’t find the docs for this, but you can see it there in action). This could contain the Common JS code, with some polyfills included.All of these can be defined in the
package.json
, and there are a few liketypings
for TS. This guide might help making sense of some of these.Other companies using Web3 opted for a separate React Native package. This is also fine and worth taking a look at, e.g. Magic Link