--
---
You received this message because you are subscribed to the Google Groups "Closure Library Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-library-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/a1bcfbed-6cd2-4031-81de-4287e91d9dacn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/CAMLmKmZXJJymuSw10O2OX09XHuLXt4mfz2oZ%3DWYod72RW8N9Hw%40mail.gmail.com.
Short answer: the debug loader is not going away any time soon, but we'd like to get rid of it someday.Longer answer: while Closure Compiler is a powerful optimizer, it does not provide the best experience for development. If there's a bug in its sourcemap handling, that would definitely be worth reporting, but overall I'd recommend using vanilla tsc to convert your TypeScript to ES modules, which esbuild can support (at least for development). To the extent you have any Closure JS, I would recommend migrating it to TypeScript. Overall, the Closure dependency management system (specifically - goog.provide, goog.require, and goog.module), while revolutionary when it was first introduced, is now a bit of a dead end, and the best bet is to move away from it whenever possible.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/CAABDHWaJeTYnHAdB4Ycey0zcAEvXRZsku2%3D-hFCpva%2Bwp5sw_w%40mail.gmail.com.
On Tue, Jul 19, 2022 at 7:20 PM 'Steve Hicks' via Closure Library Discuss <closure-lib...@googlegroups.com> wrote:Short answer: the debug loader is not going away any time soon, but we'd like to get rid of it someday.Longer answer: while Closure Compiler is a powerful optimizer, it does not provide the best experience for development. If there's a bug in its sourcemap handling, that would definitely be worth reporting, but overall I'd recommend using vanilla tsc to convert your TypeScript to ES modules, which esbuild can support (at least for development). To the extent you have any Closure JS, I would recommend migrating it to TypeScript. Overall, the Closure dependency management system (specifically - goog.provide, goog.require, and goog.module), while revolutionary when it was first introduced, is now a bit of a dead end, and the best bet is to move away from it whenever possible.That sounds like good advice in general.I guess I forgot to mention that our typescript depends on the Closure Library.So we still need something to handle things like `import Field from 'goog:goog.editor.Field';`
On Wed, Jul 20, 2022 at 1:15 AM Ryan Brown <ry...@derivita.com> wrote:On Tue, Jul 19, 2022 at 7:20 PM 'Steve Hicks' via Closure Library Discuss <closure-lib...@googlegroups.com> wrote:Short answer: the debug loader is not going away any time soon, but we'd like to get rid of it someday.Longer answer: while Closure Compiler is a powerful optimizer, it does not provide the best experience for development. If there's a bug in its sourcemap handling, that would definitely be worth reporting, but overall I'd recommend using vanilla tsc to convert your TypeScript to ES modules, which esbuild can support (at least for development). To the extent you have any Closure JS, I would recommend migrating it to TypeScript. Overall, the Closure dependency management system (specifically - goog.provide, goog.require, and goog.module), while revolutionary when it was first introduced, is now a bit of a dead end, and the best bet is to move away from it whenever possible.That sounds like good advice in general.I guess I forgot to mention that our typescript depends on the Closure Library.So we still need something to handle things like `import Field from 'goog:goog.editor.Field';`If you're using Closure Library from TypeScript, I assume you're getting typings from somewhere (I'm aware of a couple external projects that provide .d.ts versions of the library). I wonder what it would take to transform these libraries into something more standard (i.e. CommonJS, ESM, etc). It's not something we'd be looking to do (there's a handful of particularly sticky goog.provide files that we're stuck with due to thousands of usages in our codebase, but if you're not cleaning up the world, it should be quite a bit more tractable), but it could bridge some gaps and allow better interop with esbuild and others. And an approach that sat on top of the library with a repeatable transformation would have the benefit of tracking any upstream changes we push pretty trivially (IIUC that's how the .d.ts versions already work).
In a different direction, I wonder if you could take inspiration from the webpack plugin to make something that would work directly with esbuild?
Anyway, this isn't an urgent issue - it'll be at least a year or two before we're even close to thinking about doing anything with the debug loader, and there's also a possibility of just spinning it out of base.js so that it's a separate opt-in script that you could still pull in if you need it - that's also a possible end state.
--
---
You received this message because you are subscribed to the Google Groups "Closure Library Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-library-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/CAABDHWZZgAzKxFyEL1S7NA3hDw%3DkZ6Bis0ZvO3geYNkk6%2Bh66w%40mail.gmail.com.