closure-compiler
JSDoc
closure-compiler | JSDoc | |
---|---|---|
15 | 68 | |
7,254 | 14,767 | |
0.3% | 0.6% | |
9.6 | 9.3 | |
8 days ago | 3 days ago | |
Java | JavaScript | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
closure-compiler
-
Figma's Journey to TypeScript
Well, the nice thing with Python types is that the _only_ difference to untyped Python is the type annotations. Last time I worked with TypeScript (two and a half years ago), it felt more like a different language _similar_ to JS. In my experience it was quite... viral. With MyPy I've genuinely seen just specific parts of a code base become typed and didn't notice any friction.
I wonder what would happen if that proposal for type comments in JS went through. Would TypeScript become just a type checker / optimizing compiler?
Google's Closure had an (IMHO) nicer approach (https://github.com/google/closure-compiler/wiki/Types-in-the...), but I don't get the impression it'll ever catch on outside Google.
-
TypeScript Might Not Be Your God: Case Study of Migration from TS to JSDoc
The most well-known tools that rely on JSDoc are Closure Compiler (not to be confused with the Closure programming language) and TypeScript. Both of these tools can help make your JavaScript typed, but they approach it differently. Closure Compiler primarily focuses on enhancing your .js files by adding typing through JSDoc annotations (after all, they are just comments), while TypeScript is designed for .ts files, introducing its own well-known TypeScript constructs such as type, interface, enum, namespace, and so on.
-
Minify and Gzip (2022)
Closure Compiler follows the same line of thinking:
https://github.com/google/closure-compiler/wiki/FAQ#closure-...
- Svelte is migrating from TypeScript to JSDoc
-
Do any engines or optimizers product TS-specific performance gains?
I think only Google Closure Compiler did some optimizations based on its JSDoc-style annotations (see docs). If I remember correctly, types mostly allowed renaming objects' properties across modules, but most other advanced optimizations (like dead code elimination or functions inlining) didn't rely on types. In my experience properties renaming resulted in subtle, hard to discover bugs and I'd say they didn't bring much benefit.
- Can something like typescript or elm be AOT-compiled efficiently?
-
What does it mean?: *Template parameter* in Google style guide
The @template tag is supported by Google Closure Compiler
- Google announces a new OS written in Rust
-
Google Fonts Pull Requests Ignored
i'm not sure you want them to write back https://github.com/google/closure-compiler/pull/3958
time to fork
- Why don't we do this instead of TypeScript?
JSDoc
-
Figma's Journey to TypeScript
You may like JSDoc[1] if you just want some type-safety from the IDE without the compilation overhead.
It’s done wonders when I’ve had to wrangle poorly commented legacy JavaScript codebases where most of the overhead is tracing what type the input parameters are.
Personally, I’m impartial to TypeScript or JSDoc at this point. But I’d rather have either over plain JavaScript.
[1] https://jsdoc.app/
-
Eloquent JavaScript 4th edition (2024)
I wholeheartedly agree. At most, I introduce JSDoc[1] to newer developers as standardising how parameters and whatnot are commented at least gets you better documentation and _some_ safety without adding any TS knowledge overhead.
[1] https://jsdoc.app/
-
Learn how to document JavaScript/TypeScript code using JSDoc & Typedoc
This is where JSDoc comes to save the day.
-
Add typing to your Javascript code (without Typescript, kinda) ✍🏼
The best way to do this, of course, is with JSDoc. But something I always found awkward about jsdoc is defining the object types in the same file. So, after a lot of reading, I found a way to combine JSDoc with declaration type files from Typescript. Let me give you an example:
-
What is JSDoc and why you may not need typescript for your next project?
There is a lot of specific symbols presented on the JSDOC specification that can be found here: https://jsdoc.app
-
TypeScript Might Not Be Your God: Case Study of Migration from TS to JSDoc
JSDoc is a specification for the comment format in JavaScript. This specification allows developers to describe the structure of their code, data types, function parameters, and much more using special comments. These comments can then be transformed into documentation using appropriate tools.
-
Adding a search feature to my app
Working with new features, frameworks, and tools, the experience of reading documentation is a critical part of it. I have been lucky to work with projects that feature really easy to read documentation such as USWDS and Bun, but I've also had the misfortune to work with pretty terrible documentation like JSDoc. The JSDoc documentation lacks a search field which makes searching for specific items an ordeal and also does not cover many hidden use cases. It provides less than the bare minimum for what it needs to do - a lot of the time I am forced to rely on external user documentation elsewhere to use JSDoc effectively. That was why I was drawn to the search field in particular in Docusaurus.
-
JavaScript First, Then TypeScript
The Svelte team followed suit but motivated by the maintainer's developer experience as they migrated the project away from TypeScript in favor of plain JSDoc comments for type annotations instead.
-
No comments. Now what?
Even more relevant, tools like Javadoc, JSDoc, Doxygen, etc. read comments in a specific format to generate documentation. These comments do not affect readability. On the contrary, Javadocs are great for explaining how to use these entities. Combined with tools like my dear Doctest, we even get guarantees of accuracy and correctness!
-
The Complete 2023 Guide to Learning TypeScript - From Beginner to Advanced
Document types with JSDoc annotations
What are some alternatives?
swc - Rust-based platform for the Web
ESDoc - ESDoc - Good Documentation for JavaScript
terser - 🗜 JavaScript parser, mangler and compressor toolkit for ES6+
documentation.js - :book: documentation for modern JavaScript
V8 - The official mirror of the V8 Git repository
Docusaurus - Easy to maintain open source documentation websites.
cash - An absurdly small jQuery alternative for modern browsers.
apiDoc - RESTful web API Documentation Generator.
zepto - Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API
YUIDoc - YUI Javascript Documentation Tool
npm-groovy-lint - Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.