Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-3918] Full-fledged JS SDK + npm packages #3963

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

portasynthinca3
Copy link
Member

@portasynthinca3 portasynthinca3 commented Oct 18, 2024

What's new

  • Added npm packages: @flipperdevices/fz-sdk (contains the SDK, i.e. API typings and helper tooling), @flipperdevices/create-fz-app (interactive JS project creation wizard). These packages will be published manually by me if/when this pull request is merged.
  • var and const keyword support in the interpreter
  • Object.defineProperty stub
  • JS API versioning system via sdkCompatibilityStatus, isSdkCompatible, assertSdkCompatibility. This might be not the right way. Please consider: JS: Backport³ and more additions & fixes #3961 (comment)

Verification

  • Run unit tests
  • Install Node.js together with npm
  • Run the interactive project creation wizard:
    • If the packages do end up getting published, npx @flipperdevices/create-fz-app@latest
    • If not, cd js && npm exec ./create-fz-app. This will fail at the "Installing packages" step, which is expected if the package has not yet been published. Then, cd my-flip-app and change the version specifier in package.json for the fz-sdk package from ^0.1 to link:../fz-sdk
  • cd into the newly created app
  • Do npm start
  • Verify that the app launches on the Flipper

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@portasynthinca3 portasynthinca3 added New Feature Contains an IMPLEMENTATION of a new feature Documentation Everything related to docs & code comments JS JS Runtime, loader and API labels Oct 18, 2024
Copy link

github-actions bot commented Oct 18, 2024

Compiled f7 firmware for commit e24f9bcf:

@portasynthinca3 portasynthinca3 changed the title Full-fledged JS SDK + npm packages [FL-3918] Full-fledged JS SDK + npm packages Oct 18, 2024
@portasynthinca3 portasynthinca3 marked this pull request as draft October 18, 2024 18:04
@portasynthinca3
Copy link
Member Author

@hedger Please help me out with CI/CD here. Couple of things:

  1. Docs generation for JS: cd applications/system/js_app/packages/fz-sdk && pnpm install && pnpm run build-docs will put the HTML into applications/system/js_app/packages/fz-sdk/docs.
  2. Somehow link the main developer documentation with the new JS documentation
  3. fbt really wants to format the images in applications/system/js_app/packages/fz-sdk/images. They're for displaying on the web, not for putting onto the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Everything related to docs & code comments JS JS Runtime, loader and API New Feature Contains an IMPLEMENTATION of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant