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.

how can you get globals on the exported object?

See original GitHub issue

I don’t see why globals can’t be exported just like locals, thereby giving you a consistent API in your components, i.e. so you don’t have to juggle between using keys on a styles object and className strings.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
madyankincommented, Jun 4, 2020

I think I can take a look In a couple of days

On 4 Jun 2020, at 17:56, Andrea Moretti notifications@github.com wrote:

@outpunk can you point us to what part of the code filters out globals? (not sure if it is in this repo or some css-modules nested dependencies).

This would be useful for my use case in https://github.com/utilitycss/atomic as I use the keys in the json to delete rules that are not exported (e.g. whole css files coming from ICSS imports and composes) (https://github.com/utilitycss/atomic/blob/master/src/postcss/remove-unused-electrons.ts)

I was thinking that I can parse the CSS and look for :global(.myClass) instances with a regexp and include them in the custom getJSON as “myClass”: “myClass”, but that sounds like a dirty solution and would be better to not remove them in the first place.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module.export and global objects - javascript - Stack Overflow
A module is only loaded once at the first time it is required. Then the exports are cached and reused on every following...
Read more >
Global objects | Node.js v19.3.0 Documentation
These objects are available in all modules. The following variables may appear to be global but are not. They exist only in the...
Read more >
Expose Global Variables, Methods, and Modules in JavaScript
In this article, I will show you how you can expose methods, variables, and modules in JavaScript to the global namespace via import/export...
Read more >
Using guest (exported) globals - Wasmer Docs
A Wasm module can export entities, like functions, memories, globals and tables. This example illustrates how to use exported globals.
Read more >
Exporting global objects | R - DataCamp
Here is an example of Exporting global objects: Using clusterEvalQ() for setting global variables as in the last example assigns them only on...
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