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

refactor(robo/logger): browser compatibility & package module #188

Open
4 tasks
Pkmmte opened this issue Jan 6, 2024 — with Volta.net · 0 comments
Open
4 tasks

refactor(robo/logger): browser compatibility & package module #188

Pkmmte opened this issue Jan 6, 2024 — with Volta.net · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

Copy link
Member

Pkmmte commented Jan 6, 2024

Our handy logger has good potential in browsers. It looks good and I've tested that it works, but it did require various changes which I don't feel comfortable pushing because it affects Node compatibility.

We should gracefully do the following:

  • Avoid env.js import in browser environments (browsers don't like loadEnv() and its node: imports.
  • Write to console instead of process.stdout. Browsers also don't like our node:utils import for inspect, so we may need to selectively import that as well.
  • Don't flush logs in browser environments because console is synchronous.
  • Refactor color.js to selectively import node:tty outside of browser environments.

Once that's done, we should export the logger as it's own module for better bundle size: @roboplay/robo.js/logger

@Pkmmte Pkmmte added the enhancement New feature or request label Jan 6, 2024 — with Volta.net
@Pkmmte Pkmmte self-assigned this Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant