Feature Request: Isomorphic logging (browser support)
See original GitHub issueDescription / 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:
- Created 3 years ago
- Reactions:11
- Comments:8 (4 by maintainers)
Top 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 >
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 Free
Top 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
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.I’d personally be fine to have minimal features in the browser (
undefined
)