4 ms·
I am responding to your comment above: I've worked in this space and I've heard all of the argument > [require] is a magic function with untold side effects
by msoad 3y ago
I am responding to your comment above:
I've worked in this space and I've heard all of the argument
> [require] is a magic function with untold side effects
Sure, how about making it standard with a new directive? "use require" or something like that. Now require is special. You can't redefine it etc
- afavour 3y agoWell that would be a breaking change. Code is going to have to be changed. And if you’re introducing a breaking change why not try to fix all the problems? Even if require is standardised it’s still fundamentally weird. Let’s say we standardise around require only being used with static strings. Now we’re in a situation where every JavaScript function can be called with a variable as an argument except this special function called “require”, which can only receive strings. There’s no concept of that in the JS language. What we’re doing is creating a new concept. It makes sense, looking to the future, to create new syntax for it.