npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-visualforce

v0.10.7

Published

Plugin to develop Javascript Apps on Salesforce's Visualforce Technology. Develop locally and automatically deploy static resources

Downloads

20

Readme

Gulp Visualforce

Gulp Visualforce is a set of plugins that will help you develop modern javascript applications that run on top of Visualforce.

The goal and motivation of this plugin is to "make development right", the way it should be - so that it's posible to build apps with a resonable amount of time/effort.

This plugin help operate the livecycle of the application - the related modules help exchange data in a managable way.

Overview

The plugins enable development mode on localhost, something unheard of in the Salesforce Community that we take for granted on the open source world.

They open up the use of all of the gulp eco-system for application development, which means opening up the the door for Less, Sass, transformations. In short, your unique development automations.

They simplify, up to the point where it's finally posible to build apps. The developer does not have to do anything in order to publish a Visualforce Page and their Static Resources.

Workflow

You can work in 3 modes

  • Do this operations within the example folder
  • Find credentials to log in in the .env file

Local

You'll be able to run from localhost, use hot-reload and all that.

gulp --local

Advanced use cases may use the --env d and load your enviroment vars from .envd , any entry with an HTML_ suffix will be replaced on the visualforce page. This can be used to mock apex parameters from a Controller while on localhost. For more info on this please add an issue.

Semi-Local

All your files will be loaded from localhost, but the visualforce page will be uploaded and will run from within salesforce. This is very usefull for "staging?".

Note that because of iframe and security some SVG assets and/or images may not be display.

gulp

Deploy

Deploy all files as a Static Resource and the Visualforce Page is upload.

gulp dist

User the --label to name your Visualforce Page

Note

  • All path transformations between local, semi-local and deploy are handled automatically.
  • When templates, Angular or React is used (paths in javascript ) you need to adjust the url. For this we include the window._sf.staticResource which is a variable with the Static Resource URL. This is injected in deploy, points to localhost otherwise.
  • If you add custom components, do it after the HTML Tag for them to work on local

Lightning Design System

This examples include the Lightning Design System ready to use.

Running the Example

git clone https://github.com/rodriguezartav/gulp-visualforce

npm install .

gulp --local - work in localhost

gulp - work in localhost within Salesforce

gulp dist - deploy as static resource

Data ( Extra Points )

One thing is to be able to to push html,css and images; but another is to be able to also work with saleforce data. For this take a look at the example folder and use (clay-model)[https://github.com/3vot/clay-model] (clay-model-vfr)[https://github.com/3vot/clay-model-vfr] and (clay-model-salesforce-api)[https://github.com/3vot/clay-model-salesforce-api]

You'll communicate with Salesforce via the API when in Localhost and via Visualforce Remoting when you are inside Visualforce ( semi-local or deploy mode ). For this to work you must use the Clay Model Suite. Which are an interchangable API Wrappers between a standalone app and a visualforce app.

There is only one caveat I have not been able to solve yet. You must change require("clay-model-vfr") for require("clay-model-salesforce-api") between local and semilocal or deploy. This is something I'll solve any day.

Another feature is that you can develop apps that are interchagable between Visualforce and Standalone. Lighning calls this lightning out.

Notes

  • Make sure you add CORS to your Salesforce Org
  • Follow the gulp setup on the example folder

Development Org ( .env credentials )

In order to help you get started, I have provided an Dev Org with the classes already provisioned. I also took the bold move to include the .env files with the credentials to this ORG. I don't really see anything wrong with this. Feel free to propose a better way.

In order to use the plugin with Data for development from another org, you need to add the files under the /salesforce folder to your production org and use the Clay Model Suite.

If you want to develop on you own org, simple deploy them to your Org.

Using in a project

Use the plugins as I use them on gulp but using you own gulp tasks.

Clay4Salesforce

The tecnology to transfer data between Salesforce and Javascript is a suit called Clay made up of several components including models, salesforce classes and this plugin.

Using on your project

  • Copy the example folder to your prefered location
  • Edit the .env files