Skip to content

Conversation

@m2y11138
Copy link
Contributor

@m2y11138 m2y11138 commented Nov 10, 2025

What type of PR is this? (check all applicable)

  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • ♻️ Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert
  • 🌐 Internationalization / Translation

Description

This PR adds documentation for the JavaScript documentation under the supported languages section.
Includes explanations of key concepts, configuration examples, language details,
and usage snippets.
The content follows the structure and style of existing documentation
to maintain consistency across language docs.

Related Tickets & Documents

Fixes #769

Mobile & Desktop Screenshots/Recordings

No visual changes.

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentations?

  • πŸ““ docs (./docs)
  • πŸ“• storybook (./storybook)
  • πŸ“œ README.md
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

None.

[optional] What gif best describes this PR or how it makes you feel?

This is my first time working on documentation. Could you give me some advice? Thank you.

Summary by CodeRabbit

  • Documentation
    • Comprehensive JavaScript docs added: overview with external reference, interactive demo and params, usage guidance, module-loading notes, starter template, formatting and live-reload tips, and curated links.
  • New Features
    • JavaScript language info added to the language catalog/UI.
    • English locale strings added for JavaScript (name, description, link).
  • Chores
    • Editor language support expanded to include additional JS/TS module file extensions and identifiers.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Nov 10, 2025

βœ… Deploy Preview for livecodes ready!

Name Link
πŸ”¨ Latest commit 432ae1c
πŸ” Latest deploy log https://app.netlify.com/projects/livecodes/deploys/6952dec7324e9e0008d4f6d4
😎 Deploy Preview https://deploy-preview-916--livecodes.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

Add JavaScript language docs and integrate JavaScript metadata across UI, i18n, language specs, and SDK type definitions; add TypeScript "mts" and JavaScript "mjs" extensions. Changes are content additions plus small language-spec and model updates.

Changes

Cohort / File(s) Summary
Documentation
docs/docs/languages/javascript.mdx
Replaced placeholder with full JavaScript documentation: overview, MDN link, LiveCodes demo snippet, usage, module-loading examples (std lib & CDN), metadata, formatting/live-reload notes, starter template, external links.
UI language catalog
src/livecodes/html/language-info.html
Added a new JavaScript language section (HTML entry with header, description and helper links) to the language-info markup.
i18n (English)
src/livecodes/i18n/locales/en/language-info.lokalise.json, src/livecodes/i18n/locales/en/language-info.ts
Added javascript.name, javascript.desc, and javascript.link translations and wired a new javascript entry into the exported languageInfo mapping.
Language specifications
src/livecodes/languages/javascript/lang-javascript.ts, src/livecodes/languages/typescript/lang-typescript.ts
JavaScript language spec: removed info: false and expanded extensions from ['js'] β†’ ['js','mjs']. TypeScript spec: added 'mts' to extensions (['ts','mts','typescript']).
SDK models
src/sdk/models.ts
Extended the public Language union to include 'mjs' and 'mts'.

Sequence Diagram(s)

(omitted β€” changes are documentation and small metadata updates without new multi-component control-flow requiring visualization)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses issue #769 by adding JavaScript documentation, but also includes unrelated functional changes to language specs and SDK models that extend beyond the documentation objective. Separate functional changes (extensions for mjs/mts, info property removal) from documentation changes into distinct PRs to maintain clear scope and alignment with issue #769.
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope functional changes unrelated to adding JavaScript documentation: removing info:false from JavaScript specs, adding mjs extension to JavaScript and mts to TypeScript, and updating SDK Language type union. Move functional language specification and SDK model changes to a separate PR focused on supporting additional module extension types (mjs/mts).
βœ… Passed checks (3 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'docs(js): add JavaScript language documentation' accurately summarizes the primary changeβ€”adding JavaScript language documentation as part of issue #769.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • πŸ“ Generate docstrings

πŸ“œ Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 2148b87 and 432ae1c.

πŸ“’ Files selected for processing (7)
  • docs/docs/languages/javascript.mdx
  • src/livecodes/html/language-info.html
  • src/livecodes/i18n/locales/en/language-info.lokalise.json
  • src/livecodes/i18n/locales/en/language-info.ts
  • src/livecodes/languages/javascript/lang-javascript.ts
  • src/livecodes/languages/typescript/lang-typescript.ts
  • src/sdk/models.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Redirect rules - livecodes
  • GitHub Check: Header rules - livecodes
  • GitHub Check: Pages changed - livecodes
  • GitHub Check: tests (24.x, 4)
  • GitHub Check: tests (24.x, 3)
  • GitHub Check: tests (24.x, 1)
  • GitHub Check: tests (24.x, 5)
  • GitHub Check: tests (24.x, 2)
  • GitHub Check: build (24.x)
  • GitHub Check: build
πŸ”‡ Additional comments (6)
src/livecodes/html/language-info.html (1)

649-679: JavaScript language-info section looks consistent and complete

Structure, i18n keys, and links match other language sections and the new JS docs/i18n entries. No issues from my side.

src/sdk/models.ts (1)

934-937: Language union updates for mjs/mts are consistent with specs

Adding 'mjs' and 'mts' here aligns the public Language type with the updated JS/TS language specs and URL param typing. Looks good.

Also applies to: 944-945

src/livecodes/languages/javascript/lang-javascript.ts (1)

15-16: Adding mjs to JavaScript extensions is appropriate

Including 'mjs' alongside 'js' keeps runtime behavior unchanged while correctly recognizing ES module files. No further changes needed here.

src/livecodes/i18n/locales/en/language-info.ts (1)

162-166: JavaScript i18n entry matches HTML/docs

The new javascript entry (name/desc/link) is consistent with the HTML language-info section and the JS docs page. Auto-generated structure looks correct.

src/livecodes/languages/typescript/lang-typescript.ts (1)

47-49: mts extension support for TypeScript is correctly wired

Including 'mts' in the TypeScript extensions array is consistent with the updated Language type and enables TS module files without changing any compile behavior.

src/livecodes/i18n/locales/en/language-info.lokalise.json (1)

359-370: Lokalise JavaScript entries are in sync with TS template

The new javascript.desc, javascript.link, and javascript.name entries mirror the TypeScript language-info template and HTML content. Auto-generated JSON looks consistent.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 2383e67 and 977c9ee.

πŸ“’ Files selected for processing (1)
  • docs/docs/languages/javascript.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Redirect rules - livecodes
  • GitHub Check: Header rules - livecodes
  • GitHub Check: tests (18.x, 3)
  • GitHub Check: build
  • GitHub Check: tests (18.x, 4)
  • GitHub Check: tests (18.x, 1)
  • GitHub Check: tests (18.x, 2)
  • GitHub Check: tests (18.x, 5)
  • GitHub Check: build (18.x)
  • GitHub Check: Pages changed - livecodes
πŸ”‡ Additional comments (6)
docs/docs/languages/javascript.mdx (6)

7-16: Verify template naming consistency.

The demo uses template name "Javascript" (capitalized). Ensure this matches LiveCodes' actual template identifier and is consistent with the starter template URL on line 80.


18-42: Usage section is well-structured and accurate.

The module loading guidance is clear, the CDN example is practical and correct, and the reference to JSX/framework extensions appropriately bridges to related language variants.


50-52: Reconsider the "node" aliasβ€”it may create confusion.

The introduction (line 5) explicitly states that LiveCodes JavaScript lacks Node.js features such as the file system. Including "node" as an alias could mislead users into thinking Node.js code is supported. Consider whether this alias is necessary or if it should be removed for clarity.


44-68: Verify metadata format and naming conventions.

The Language Info section appears complete, but without access to other language documentation files, I cannot confirm if the metadata format, naming convention (Javascript vs. javascript), and editor type ("script") are consistent with existing language entries. Please verify these against existing language documentation files in the docs/docs/languages/ directory.


74-76: Live Reload section is clear and accurate.

The description appropriately conveys the immediate feedback benefit of automatic code reloading.


78-85: External links are authoritative and appropriate.

The MDN references provide valuable supplementary resources. The starter template URL appears well-formed, assuming the template parameter Javascript matches LiveCodes' configured identifier (verify alongside the demo section).

Update javascript.mdx to fix some grammatical issues
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 977c9ee and 60fda39.

πŸ“’ Files selected for processing (1)
  • docs/docs/languages/javascript.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Redirect rules - livecodes
  • GitHub Check: build
  • GitHub Check: build (18.x)
  • GitHub Check: tests (18.x, 2)
  • GitHub Check: tests (18.x, 5)
  • GitHub Check: tests (18.x, 3)
  • GitHub Check: tests (18.x, 1)
  • GitHub Check: tests (18.x, 4)
  • GitHub Check: Header rules - livecodes
  • GitHub Check: Pages changed - livecodes
πŸ”‡ Additional comments (1)
docs/docs/languages/javascript.mdx (1)

1-85: Well-structured and comprehensive documentation.

The documentation provides clear explanations, practical code examples (e.g., CDN module loading with Lodash), accurate information about browser environment vs. Node.js, and follows the expected template structure. The past spacing issues have been resolved. Links to MDN and Web APIs are appropriate. The demo component params and starter template URL are properly configured.

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

@hatemhosny
Copy link
Collaborator

Thank you @m2y11138

I have added some details for JavaScript usage in LiveCodes.
Much appreciated 🌹

@hatemhosny hatemhosny merged commit 0d93335 into live-codes:develop Dec 29, 2025
15 checks passed
@livecodes-ci
Copy link
Contributor

livecodes-ci bot commented Dec 29, 2025

i18n Actions

Source PR has been merged into the default branch.

Maintainers can comment .i18n-update-push to trigger the i18n update workflow and push the changes to Lokalise.

@hatemhosny
Copy link
Collaborator

.i18n-update-push

@livecodes-ci
Copy link
Contributor

livecodes-ci bot commented Dec 29, 2025

i18n Actions: .i18n-update-push

Localization updated and pushed to Lokalise.

Name Description
New Branch for i18n i18n/m2y11138/add_js_languages_docs
Last Commit SHA 0d93335

Maintainers can comment .i18n-update-pull after translation is done to trigger the i18n pull workflow and pull the changes back to Github.

@hatemhosny
Copy link
Collaborator

.i18n-update-pull

@livecodes-ci
Copy link
Contributor

livecodes-ci bot commented Dec 29, 2025

i18n Actions: .i18n-update-pull

Localization pulled from Lokalise.

Name Description
i18n Branch i18n/m2y11138/add_js_languages_docs
Last Commit SHA 50a8663
i18n PR #932

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing language docs

2 participants