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.

A plugin to replace .env variables in a certain manner. Initially proposed in #77. Initial design used regex to replace anything surrounded by handlebars. I think we should use deno_swc which will allow us to instead replace Deno.env. anything. We could possibly look into requiring ALEPH_PUBLIC_ prefix to .env variables unless it is accessed inside a useDeno hook.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

4reactions
ijecommented, Jan 4, 2021

for example, we can transform graphql string to AST at build time with macro:

import gql from 'https://deno.land/x/aleph/macros/graphql.macro.ts'

const query = gql`
  {
    user(id: 123) {
      firstName
      lastName
    }
  }
`

output code:

const query = {
  "kind": "Document",
  "definitions": [ ... ]
}
3reactions
ijecommented, Jan 4, 2021

i perfer a new concept swc-marco can be a solution:

import env from 'https://deno.land/x/aleph/swc-macros/env.macro.ts'

const value = env('KEY')

it will be transpiled to below code:

const value = __ALEPH_ENV.get('KEY')

and the macro will export the deno.env as __ALEPH_ENV.

what do you think? @shadowtime2000 @alfredosalzillo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add SWC Plugin · Issue #144 · kentcdodds/babel-plugin-macros
Looking at which babel plugins create-react-app uses it seems like most of those things are supported by swc (with only a few exceptions)....
Read more >
Implementing a plugin - SWC
You can install a rust-based CLI for SWC by doing. cargo install swc_cli ... is a macro call, and it returns various types...
Read more >
An experimental transpiler to bring tailwind macros to SWC
This is an experimental SWC transpiler to bring compile time tailwind macros to SWC (and nextjs) a-la twin macro. The goal is to...
Read more >
macro swc* | SAP Community
hi, i would like to ask on the macro, for example, swc_get_element and other swc_* in business object. why we need to use...
Read more >
SWC macro shot - dive watches, swiss watches, diver - Pinterest
May 10, 2019 - Explore Swiss Watch Company's board "SWC macro shot" on Pinterest. See more ideas about dive watches, swiss watches, diver....
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