Tagged template literals and wizardry
See original GitHub issueHere 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:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
When does it stop being a decorator and becomes its own language? Or is JavaScript a decorator of C++?