3/19/2024 0 Comments Import es6 minified file js![]() GWT got away with this environment lock and multiple NIH because of release timeframe. Looks like you favor platform and see solutions in optimizing for that case. This is more of design choice between providing full platform or platform specific tools to make kotlin code cross platform. IMHO this is not about specific features of compiler or stdlib. From this point of view I see no reason to spend effort implementing DCE inside kotlin itself since js tools already exist for such tasks and on Jvm/Android side proguard looks like standard. Correct me if I’m wrong but initial GWT release was even before jquery. js was not a hot topic, no popular tools existed etc. Since kotlin is tiny fraction of js world any restriction or even bumps like limited dce in integration will hurt kotlin adoption in this kind of use cases hard. There is no point implementing all js existing infrastructure and frameworks in kotlin. I’m talking about full bundling/integration solution. You look at problem from stand of kotlin compiler/toolset. So I would implement DCE via ES6 modules only when there’s no other observable short-term ways. It’s definitely good to have this target, but it’s a long-term task to support it completely. This DCE may rely on our knowledge of structure of code produces by Kotlin compiler, so it may be more efficient for Kotlin that general-purpose DCE tools.Īs for me, the problem with ES6 is somewhat strange if we implement only small part of it. Kotlin compiler has a lot of code for optimizing/analysing JS code, so we don’t need to write everything from scratch. Unless kotlin team wants to implement DCE for js itself. We can simply include all metadata necessary for DCE. As for kotlin.js, we can’t compile against any Kotlin library if you provide only raw JS. ![]() It won’t, but you can use Kotlin built-in DCE to reduce size of Kotlin-generated code and WebPack2/Roollup for external dependencies. Will not cut external dependencies and kotlin.js stdlib itself Also, we can start with pretty simple implementation and then improve it. But my observations tell me that DCE which uses typing information works much better than DCE for dynamically-typed languages like JS. In ES6 Modules, you can export variables, functions, or classes to make them accessible in other modules.Yes, that’s right. Creating and Exporting Modules Exporting Variables and Functions ES6 Modules standardized this process, making it easier to manage dependencies and promote code reuse. Before ES6 Modules, JavaScript lacked a built-in module system, leading developers to rely on various workarounds like Immediately Invoked Function Expressions (IIFEs) or global variables. JavaScript Modules are a way to organize code into reusable and maintainable files. In this article, we will delve into the world of ES6 Modules, exploring their features, syntax, and best practices to help you master this essential aspect of modern JavaScript development. Among these, ES6 Modules revolutionized the way JavaScript code is organized and shared. In the ever-evolving landscape of JavaScript development, ECMAScript 6 (ES6) brought with it a wealth of new features and enhancements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |