linuxmint / linuxmint/cinnamon

Typescript support (or at least declarations) inside Cinnamon

Open
#11,272 16 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

FEATURE REQUEST
Dominant language
JavaScript
Stars
5.6k
Forks
915
Avg merge
5d 22h
Merged PRs (30d)
3

Description

Is your feature request related to a problem? Please describe.

This includes allowing writing code in Typescript not just in Javascript. This includes:

  1. Provide Typescript declarations under imports.gi, generating Cinnamon specific libs during build and provide for those we explicitly depend on.
  2. Provide Typescript declarations in the JS folder as d.ts
  3. Allow writing code in typescript and generating js and d.ts files during build - this might need some extra effort so typescript knows about those libraries in imports.
Describe the solution you'd like
  1. I've got a repository that does just that (output is stored here), it is pretty solid and used with some applets already. I'm happy to transfer over the repo to the Cinnamon team and still maintaining it myself.
  2. This is a relatively easy task if the 1st step is done (technically 1. can be provided outside of Cinnamon itself for development) - downside is that these will be maintained alongside the JS files. I'm more than happy to commit to write them and maintain them myself.
  3. If imports are correctly resolve before (in TS) and after build (in JS) the codebase can be slowly converted .
Describe alternatives you've considered
Additional context - why?
  1. Personally I'd like to add more features to js->ui->windowManager, this is why I opened this request.
  2. Could reduce regressions in the JS codebase because it will be typed.
  3. Could provide better support for applets/extensions/desklets with correct types in editors with docstrings
  4. Could reduce cognitive load to people working on the JS codebase and maybe help people open more PRs because the codebase functionality is easier to read, because everything in imports is not opaque as it is now or requires to read up documentation (if it exists - I'm looking at the Cinnamon specific libs in imports especially.)
  5. Could enforce better code quality
Possible problems
  1. One more thing added to the toolchain Cinnamon is built with
  2. (Slightly) higher level of entry of writing JS code and a bit more work to setup the dev environment

Please respond if you think it's worth having a discussion about, especially that I can pledge to to most of the work around this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the requested integration points under imports.gi, the JS folder, and the build process, then examine the linked GIR2TS and types-cjs repositories. Define how declarations are generated and how TypeScript sources produce JavaScript and .d.ts files. Done means the build supports the proposed declarations and TypeScript workflow without breaking existing JavaScript development.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.