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.

Tagged template literals and wizardry

See original GitHub issue

Here is a totally crazy idea. I am posting it here because I don’t have time to work on it right now.

If this is just too crazy for fly, I can accept it (I can already see it might be too crazy indeed). A new module would do just fine in that case.

const source = ["src/**/*.js", "!src/ignore/**/*.js"]
const target = ["dist/app.js"]

module.exports = `
    watch ${source} >
        eslint {no-extra-semi: 0}
        babel {es2015, state-0}
    > concat > target > ${target}
`

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Jan 11, 2017

Lol you can call it an abstraction if it makes you feel more comfortable that way.

But right now, as you have it, it still uses template literals, injecting source and using api methods. You can regex this down and perform some behind the scenes magic so that Fly gets what it wants, and that’s what defines an abstraction/decorator pattern.

It’s up to you and how far you want to take this syntax. Obviously, at some point, it becomes its own thing (or more like a Make clone). You’ll have to decide if it still should compile down to fly-compatible exports, or becomes its own runner.

Worth exploring if you’re interested.

0reactions
jorgebucarancommented, Jan 11, 2017

When does it stop being a decorator and becomes its own language? Or is JavaScript a decorator of C++?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React & CSS-in-JS: ES6 Objects vs Tagged Template Literals
This article provides my rationalisation for preferring JS objects for stylesheets instead of Sass within TTLs.
Read more >
JavaScript | template literals - GeeksforGeeks
Template Literal in ES6 provides new features to create a string that ... Tagged Templates: One of the features of Template Literals is...
Read more >
Template Literals (And Why You Should Use Them) - Medium
Tagging template literals is another feature that I will discuss. This give you the ability to run a template string through a function, ......
Read more >
Template literals in vanilla JS - Go Make Things
Introduced in ES6, template literals provide a simpler way to create strings that span multiple lines or contain data.
Read more >
aaj/form-wizardry - GitHub
You are responsible for making these templates yourself, but Django gives you a guarantee: each one of your templates will be given a...
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