Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

With Pulsar running on Android and Windows, you can debug your HTML/Javascript code from a local server running on your own development machine. This productivity feature allows you to bypass the time-consuming process of uploading a new .pulsarapp bundle to Salesforce servers and resyncing the Pulsar app.

Org Setup

  • pulsar.developer.enableDevelopmentServer – Pulsar Setting must be set to TRUE

  • pulsar.developer.users{.DocId} – List of developer usernames (e.g., you@yourorg), separated by comma, semicolon, or newlines for a specific document.  Note that {.DocId} can be empty, in which case this is an org-global list of developers (for all documents!)

  • We recommend that you only have these setup for your testing orgs, and never for your production orgs!

Local Development Setup

  • First make sure your local development server (HTTP only) is running on port 3002 of your development machine. You may wish to use or extend the simple server scripts that are published in https://github.com/luminixinc/PulsarForSalesforceJSExamples. Once the server is running, verify in your browser that you can reach http://127.0.0.1:3002 – (NOTE of course, that Javascript calls into Pulsar will fail when your server is accessed from your browser).

  • For development with Pulsar on Windows, you must be running the Pulsar app on the same Windows machine as your local server. You will also need to ensure that the Pulsar app has loopback exemption:

    • CheckNetIsolation.exe LoopbackExempt -a -n="E3D1A000.PulsarforSalesforce_ta6n8xy84gcpg"

    • Verify that Pulsar is showing in the exemption list: CheckNetIsolation.exe LoopbackExempt -s

  • For development with Pulsar on an Android device, you must have that device connected to your development machine via ADB (either USB cable or via network) with reverse port forwarding set up.

    • Your Android device must have Developer Options and USB Debugging enabled

    • Set up reverse port forwarding from your development machine: adb reverse tcp:3002 tcp:3002

    • Note that the ADB client/server can sometimes gets disconnected (and the reverse rule purged).  You will need to recreate the rule after re/connection to the device. You can double-check that you have reverse port-forwarding of 3002 in place: adb reverse --list

Pulsar Setup

  • Login to Pulsar and make sure your organization is fully synced at least once, including your Content Library documents

  • From the Settings page, toggle the development server on

    • If you do not see the toggle, then it is likely that your org is not configured correctly for development mode (for your specific username)

  • Note that once the development server toggle is on, it is sticky per-session.  You will need to re-toggle it if you re-login or re-start the Pulsar app

HTML/JS Development REPL Flow in Pulsar

  • In the Pulsar app, Find the the specific HTML/.pulsarapp document (in your Content Library) you want to debug and download/open it

    • First, Pulsar will load the document/bundle that is synced from your org (the org version)

    • Next, Pulsar will load from your development server (http://127.0.0.1:3002); on Android this is forwarded over ADB.

    • NOTE that this means you can move backward and forward using the window history buttons to switch between the org and development versions (if desired)

  • Because Pulsar is loading your HTML/JS code from your development server on your development machine, you should now be able to use all your normal HTML/JS debugging tools on the code running locally on your development machine

  • If you make a change to your HTML/JS code, simply restart your development server and hit the page refresh button in Pulsar

  • No labels