Keep in mind that in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global. There's also efforts underway to actually write modules into future specs if they haven't alreadyspec: (I believe they haven't yet).http://wiki.ecmascript.org/doku.php?id=harmony:modules
Keep in mind that in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global. There's also efforts underway to actually write modules into future specs if they haven't already (I believe they haven't yet).
Keep in mind that in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global. There's also efforts underway to actually write modules into future spec: http://wiki.ecmascript.org/doku.php?id=harmony:modules
And keepBut There Are Implementations of JS With Packages/Modules
Keep in mind, that in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global. There's also efforts underway to actually write modules into future specs if they haven't already (I believe they haven't yet).
And keep in mind, in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global.
But There Are Implementations of JS With Packages/Modules
Keep in mind that in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global. There's also efforts underway to actually write modules into future specs if they haven't already (I believe they haven't yet).
What I don't personally like about packages on the client-side web is that we'd basically be pretending we're doing something that we're really not. In a post .NET webforms and gobs-of-horrifying-stuff-that-never-panned-out-from-our-Java-friends world, I'd rather think of a hunk of HTML with linked resources as what it really is and not try to appease learning-new-things-resistant OS app developers by pretending it's something else. In JS on the client-side web, nothing gets "imported" barring doing something awful with Ajax that operates in ignorance of browser-caching, which yes, many have tried to do. All that matters to the browser is that it was either loaded in and interpreted or it wasn't. We don't have more code stashed on the client somewhere available for use "just in case" for good reasons. #1 being that I just described a plug-in and browser plug-in dependencies for web apps as a phenomenon has not generally pannedworked out too well. We want web now. Not after Adobe or Sun is done updating the third time this week.
And keep in mind, in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them and knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global.
What I don't personally like about packages on the client-side web is that we'd basically be pretending we're doing something that we're really not. In a post .NET webforms and gobs-of-horrifying-stuff-that-never-panned-out-from-our-Java-friends world, I'd rather think of a hunk of HTML with linked resources as what it really is and not try to appease learning-new-things-resistant OS app developers by pretending it's something else. In JS on the client-side web, nothing gets "imported" barring doing something awful with Ajax that operates in ignorance of browser-caching, which yes, many have tried to do. All that matters to the browser is that was either loaded in and interpreted or it wasn't. We don't have more code stashed on the client somewhere available for use "just in case" for good reasons. #1 being that I just described a plug-in and browser plug-in dependencies for web apps as a phenomenon has not generally panned out well. We want web now. Not after Adobe or Sun is done updating the third time this week.
And keep in mind, in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding files as you need them and knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global.
What I don't personally like about packages on the client-side web is that we'd basically be pretending we're doing something that we're really not. In a post .NET webforms and gobs-of-horrifying-stuff-that-never-panned-out-from-our-Java-friends world, I'd rather think of a hunk of HTML with linked resources as what it really is and not try to appease learning-new-things-resistant OS app developers by pretending it's something else. In JS on the client-side web, nothing gets "imported" barring doing something awful with Ajax that operates in ignorance of browser-caching, which yes, many have tried to do. All that matters to the browser is that it was either loaded in and interpreted or it wasn't. We don't have more code stashed on the client somewhere available for use "just in case" for good reasons. #1 being that I just described a plug-in and browser plug-in dependencies for web apps as a phenomenon has not generally worked out too well. We want web now. Not after Adobe or Sun is done updating the third time this week.
And keep in mind, in Node.js, where such things make a lot more sense, they do have modules. JS, assuming we can avoid uber-config-hell that plagues other languages, is the only thing in the equation and each executed file is its own isolated scope. But on a web page, linking a js-file is itself the import statement. Doing more imports on the fly is just a waste of time and resources since getting the resources requires a lot more effort than simply adding links to files as you need them knowing they'll be cached in a browser if another page needs them again. So is trying to split up the global space by doing anything other than create adapter object factories like jQuery or more traditional objects that cover a large subset of tasks in a given domain while occupying one spot in global.