Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Zinnia as module #236

Open
juliangruber opened this issue May 30, 2023 · 2 comments
Open

Export Zinnia as module #236

juliangruber opened this issue May 30, 2023 · 2 comments
Assignees

Comments

@juliangruber
Copy link
Member

juliangruber commented May 30, 2023

See filecoin-station/spark#2 (comment) for additional context.

Expose Zinnia as a module instead of a global:

import { Zinnia } from 'zinnia'
@bajtos
Copy link
Member

bajtos commented May 30, 2023

@juliangruber I am leaning towards finer-grained modules.

import {walletAddress, activity} from 'zinnia:station';
import {peerId, requestProtocol} from 'zinnia:libp2p';

WDYT?

@juliangruber
Copy link
Member Author

Initial thoughts: Having these fields non-namespaced will make it likely for there to be collisions with user variables. We can still expose this way, but then I guess a more common pattern would be to import with an asterisk:

import * as station from 'zinnia:station';
import * as libp2p from 'zinnia:libp2p';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧊 icebox
Development

No branches or pull requests

2 participants