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.

Is Lebab a tool for real world?

See original GitHub issue

Consider I have a very simple code using a namespace to bundle functionality under a name. I try to turn this code to ES6 using Lebab and I expect to see some classes but it seems Lebab fails to transpile this code (I saw this is a known issue #113 ).

Namespaces are a very common pattern, so what is the goal of using this kind of tools when they fail to provide new modern features of ES? I think very basic operations like changing var to const, removing “use strict” directives and etc. are not enough to use these kind of tools to transpile a real code. This not the only snag or limitation, consider a ES6 Code without Reflection, Proxying and etc…

**` var Bamblip = { Message: ’ ', };

Bamblip.Init = function() { Bamblip.Message = 'Hello '; };

Bamblip.Welcome = function(name) { Bamblip.Init(); alert(Bamblip.Message + name) }

Bamblip.Welcome(‘Bamblip’); `**

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mohebifarcommented, Jul 23, 2016

You need to know that:

  • Some transformers are not safe.
  • Some transformers are so unsafe that won’t be implemented.
  • Lebab transforms ESx codes to ESy codes (x < y). However, it doesn’t mean that you can write your code in ES5 and expect Lebab to do a magic and create a new different elegant code. That is actually what you as a programmer are supposed to do.

But what you mean by a modern code in “real world”? Let’s say we have this code:

fetch(URL)
.then(result => {
    dataLoaded(result);
})
.catch(error => {
    showError(error);
});

It uses promises. Do you think this is a modern code?

But what about this one?

co(function *() {
    try {
        const result = yield fetch(URL);
        dataLoaded(result);
    } catch (error) {
        showError(result);
    }
});

Wait! What about this?

async function () {
    try {
        const result = await fetch(URL);
        dataLoaded(result);
    } catch (error) {
        showError(result);
    }
};

So I think you’re expecting Lebab something that is not supposed to do.

The answer is “YES”. I think we’re living in a world that Lebab is doing what it has to do.

0reactions
Bamblipcommented, Jul 23, 2016

Lebab eases the pain of modernizing an old code.

I hope it eases well! 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Humble Kebab: an unlikely tool for unity | by Matilda Jarvis
The Kebab was invented to be fuel to the common labourer, a simple construction of ingredients as we have seen above. All this...
Read more >
A tasty tool of change - Los Angeles Times
The aim is to enhance the image of the kebab industry and give its workers, most of whom are first- and second-generation Turkish...
Read more >
Kebab - Wikipedia
Kebab or kabob (North American) is a type of cooked meat dish that originates from cuisines ... world, including the skewered shish kebab...
Read more >
What is DöNer Kebab? (with pictures) - Delighted Cooking
Döner kebab is a traditional Turkish dish made from meat roasted vertically on a spit. It is closely related to Greek gyros and...
Read more >
Kebab World on Vimeo
A digital representation of late-night urban existence reflected in the window of a kebab shop. As a 'synthetic meat', doner kebabs seem an ......
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