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 3 Next »

NOTE: Local Development Server feature is available in the Pulsar for Salesforce 3.8 pre-releases for Android and Windows. Some of the features listed here may change before official release.

Debugging your HTML/Javascript code in Pulsar doesn't require you to upload a bundle to Salesforce servers.  With some configuration, you can instead have Pulsar load directly from a local development server on your own development machine.

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. (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.

  • 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 possibly you are running a pre-3.8 version of Pulsar, or the org is not setup 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, go to the specific HTML document (or .pulsarapp document) you want to debug and 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