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.

Support JSON/Objects in Escaped Template Parts

See original GitHub issue

The scenario I’m talking about is:

const Title = styled("h1")`
  font-weight: bold;
  ${p => ({ color: "dodgerblue" })};
`;

As far as I can tell this just gets serialized to [Object object]. This was brought to my attention due to someone trying to use Styled System(https://github.com/styled-system/styled-system) with Goober which works this way apparently. It lets developers replace common transformations with premade functions. Cool in concept at least.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cristianbotecommented, Oct 20, 2020

Alrighty! Due to popular demand and low footprint in size, this is working for tagged templates as well. Available in 2.0.9. Thanks for reaching out and pursue this! Much appreciate it!

1reaction
praneybehlcommented, Oct 7, 2020

Thanks @cristianbote, I guess it can be used as a workaround. Maybe, I’ll have a look to see what is needed to get it working with tagged templates.

Cheers 👍🏼

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSONObject contains escape characters - java - Stack Overflow
JSONObject is correctly encoding the string. This page describes how string literals are to be escaped in JavaScript (and, by extension, JSON).
Read more >
Escape characters within JSON object not working - ServiceNow
I've tried escaping the escape with "\\n". The same issue is occurring when updating an Alert manually through a glide record object.
Read more >
Multiple problems parsing JSON, escaping, encoding ... - GitHub
This is problematic for un-escaping a JSON string because it lacks support for the \uXXXX escape, converting the \u to a u ....
Read more >
Introduction to JSON-Java (org.json) - Baeldung
Learn ways to escape a JSON String core Java or a library ... For the complete list of methods supported by JSONObject, visit...
Read more >
JSON - JavaScript - MDN Web Docs
The JSON object contains methods for parsing JavaScript Object Notation (JSON) and converting values to JSON. It can't be called or constructed.
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