question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Isomorphic logging (browser support)

See original GitHub issue

Description / Use Case for a Feature

As I’ve said before, I’m really loving tslog in Blitz apps! But there’s one thing I really wish tslog supported, and that is logging in the browser.

Currently I have to be constantly making a cognitive choice between using tslog or console.log based on if I’m in a server or browser context. And this is often since Blitz is a fullstack monolith.

Possible implementation

Provide a separate browser bundle (via package.json browser field) that has a minimal logger without any node.js dependencies. Should be a small as possible for bundle size concerns. Ideally it would accept all the same options, but some of the options would be no-op in the browser.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
terehovcommented, Feb 16, 2021

Thank you very much. It is on my mind for quite some time and you make quite a good suggestion. That is definitely something I would like to add to a 4.0 release. The problem I’ve been stumbling on is how to provide the same API and access all the meta-information without having V8 in place. That would basically mean, either leaving them undefined, or using some weird hacks like throwing an error and evaluating the string that came out of it.

5reactions
flybayercommented, Feb 16, 2021

I’d personally be fine to have minimal features in the browser (undefined)

Read more comments on GitHub >

github_iconTop Results From Across the Web

A broader view on isomorphic JavaScript - Jos de Jong
We need unified, isomorphic solutions for common functionality like module loading, networking, background processes, logging, and others.
Read more >
http - isomorphic-git
You need to pass an HTTP client into isomorphic-git functions that make HTTP requests. Both a node client ( isomorphic-git/http/node ) and a...
Read more >
Five Challenges to Building an Isomorphic JavaScript Library
First we must determine how to make a fetch request. The browser can send a fetch request natively, but to support Node.js, either...
Read more >
Modern JavaScript libraries: the isomorphic way - Algolia Blog
Not to mention, the AlgoliaSearch JavaScript client had a really smart failover request strategy: use XMLHttpRequest for browsers supporting ...
Read more >
Why Everyone is Talking About Isomorphic / Universal ...
Quick Overview of Web Development · Most search engines don't support client-side rendering when crawling websites. · As SPAs become larger they require...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found