All Projects → trailheadapps → visualforce-to-lwc

trailheadapps / visualforce-to-lwc

Licence: CC0-1.0 License
A collection of code examples to help you move from Visualforce to LWC.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Apex
172 projects

Projects that are alternatives of or similar to visualforce-to-lwc

quiz-host-app
Multiplayer quiz app built on Salesforce technology (host app)
Stars: ✭ 69 (-25%)
Mutual labels:  salesforce, lightning-web-components
apex-rollup
Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
Stars: ✭ 133 (+44.57%)
Mutual labels:  salesforce, lightning-web-components
lwc-streaming-api
Lightning Web Component Streaming API
Stars: ✭ 25 (-72.83%)
Mutual labels:  salesforce, lightning-web-components
fast-sfdc
A VSCode plugin to develop Salesforce projects in vscode
Stars: ✭ 16 (-82.61%)
Mutual labels:  salesforce, visualforce
one-pub-sub-lwc
One PubSub: A Declarative PubSub Library for Lightning Web Component and Aura Component
Stars: ✭ 19 (-79.35%)
Mutual labels:  salesforce, lightning-web-components
PaymentForm
A form that takes credit card and address information. Uses a ported version of jessie pollack's card component.
Stars: ✭ 40 (-56.52%)
Mutual labels:  salesforce, lightning-web-components
awesome-lwc
A list of interesting on platform Lightning Web Components resources and code examples
Stars: ✭ 124 (+34.78%)
Mutual labels:  salesforce, lightning-web-components
lightning-chatter-messenger
⚡ Lightweight Chatter messenger utility item, which supports real-time private conversation, in Salesforce Lightning Experience. Built by Lightning Web Component.
Stars: ✭ 33 (-64.13%)
Mutual labels:  salesforce, lightning-web-components
timeline-component-lwc
This component enables timeline view for Salesforce Record history.
Stars: ✭ 18 (-80.43%)
Mutual labels:  salesforce, lightning-web-components
dreaminvest-lwc
Sample application for Lightning Web Components on Salesforce Platform. Part of the sample gallery. Financial services use case. Get inspired and learn best practices.
Stars: ✭ 41 (-55.43%)
Mutual labels:  salesforce, lightning-web-components
lwc-soql-builder
Awesome SOQL execution tool developed in Lightning Web Components Open Source
Stars: ✭ 85 (-7.61%)
Mutual labels:  salesforce, lightning-web-components
lwc-redux
Integrate Redux with Lightning Web Component
Stars: ✭ 35 (-61.96%)
Mutual labels:  salesforce, lightning-web-components
ecars
Sample application for Lightning Web Components and Salesforce Platform runtime and compute capabilities. Part of the sample gallery. Electric car manufacturer use case. Get inspired and learn best practices.
Stars: ✭ 132 (+43.48%)
Mutual labels:  salesforce, lightning-web-components
sf-sandbox-post-copy
A framework for managing automation tasks that are fired upon sandbox refresh in Salesforce orgs.
Stars: ✭ 44 (-52.17%)
Mutual labels:  salesforce
ApexTriggerHandler
Another library implements Apex trigger handler design pattern.
Stars: ✭ 40 (-56.52%)
Mutual labels:  salesforce
Salesforce-Short-Hands
The main purpose of this repository is to put all the utilities in one place so that other developers can get help and they can also contribute to this repo.
Stars: ✭ 31 (-66.3%)
Mutual labels:  salesforce
sfpowerscripts
A build system for modular development in Salesforce, delivered as a sfdx plugin that can be implemented in any CI/CD system of choice
Stars: ✭ 121 (+31.52%)
Mutual labels:  salesforce
DXB
A utility cli plugin built on top of #SFDX to facilitate devops.
Stars: ✭ 20 (-78.26%)
Mutual labels:  salesforce
sfdx-js
A TypeScript compatible JavaScript wrapper for Salesforce DX CLI.
Stars: ✭ 30 (-67.39%)
Mutual labels:  salesforce
APEX-Q
A promise library for Salesforce
Stars: ✭ 30 (-67.39%)
Mutual labels:  salesforce

Visualforce to LWC

CI Workflow Packaging Workflow codecov

Visualforce to LWC logo

A collection of code examples to help you move from Visualforce to LWC. Each example shows a typical Visualforce pattern and its equivalent implementation in LWC. On each example, there's a link that takes you right to the Visualforce or LWC code in GitHub. Heavy usage of base components and features as Lightning Data Service.

Trailhead Badge Learn more about this app by completing the Quick Start: Explore the Visualforce to LWC Sample App Trailhead project.


Table of contents

Installing the app using a Scratch Org

  1. Set up your environment. Follow the steps in the Quick Start: Lightning Web Components Trailhead project. The steps include:

    • Enable Dev Hub in your Trailhead Playground
    • Install Salesforce CLI
    • Install Visual Studio Code
    • Install the Visual Studio Code Salesforce extensions
  2. If you haven't already done so, authorize with your hub org and provide it with an alias (myhuborg in the command below):

    sfdx auth:web:login -d -a myhuborg
    
  3. Clone the visualforce-to-lwc repository:

    git clone https://github.com/trailheadapps/visualforce-to-lwc
    cd visualforce-to-lwc
    
  4. Create a scratch org and provide it with an alias (visualforce-to-lwc in the command below):

    sfdx force:org:create -s -f config/project-scratch-def.json -a visualforce-to-lwc
    
  5. Push the app to your scratch org:

    sfdx force:source:push
    
  6. Assign the Visualforce_to_LWC permission set to the default user:

    sfdx force:user:permset:assign -n Visualforce_to_LWC
    
  7. (Optional) Assign the Walkthroughs permission set to the default user.

    Note: this will enable your user to use In-App Guidance Walkthroughs, allowing you to be taken through a guided tour of the sample app. The Walkthroughs permission set gets auto-created with In-App guidance activation.

    sfdx force:user:permset:assign -n Walkthroughs
    
  8. Import sample data:

    sfdx force:data:tree:import -p ./data/sample-data-plan.json
    
  9. Open the scratch org:

    sfdx force:org:open
    
  10. In Setup, under Themes and Branding, activate the Visualforce to LWC theme.

  11. In App Launcher, click View all then select the Visualforce to LWC app.

Installing the app using an Unlocked Package

Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org or if you don't want to install the local developement tools. You can use a non source-tracked orgs such as a free Developer Edition Org or a Trailhead Playground.

Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done.

  1. Log in to your org

  2. Click this link to install the Visualforce to LWC unlocked package in your org.

  3. Select Install for All Users

  4. Import Account and Contacts data:

    • Click here to acccess the Accounts-Contacts.csv file. Right click in the browser window and save the file as Accounts-Contacts.csv.
    • In Setup, type Data Import in the Quick Find box and click Data Import Wizard.
    • Click Launch Wizard.
    • Click Accounts and Contacts, and click Add New Records.
    • Select Match Account by: Name & Site.
    • Drag the Accounts-Contacts.csv file you just saved to the upload area.
    • Click Next, Next, and Start Import.
  5. If you're attempting the Quick Start on Trailhead, this step is required, but otherwise, skip:

    • Go to Setup > Users > Permission Sets.
    • Click Visualforce_to_LWC.
    • Click Manage Assignments.
    • Check your user and click Add Assignments.
  6. In Setup, under Themes and Branding, activate the Visualforce to LWC theme.

  7. In App Launcher, click View all then select the LWC app.

Installing the App using a Developer Edition Org or a Trailhead Playground

Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org. This includes non source-tracked orgs such as a free Developer Edition Org or a Trailhead Playground.

Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done.

  1. Clone this repository:

    git clone https://github.com/trailheadapps/visualforce-to-lwc
    cd visualforce-to-lwc
    
  2. Authorize with your Trailhead Playground or Developer org and provide it with an alias (mydevorg in the command below):

    sfdx auth:web:login -s -a mydevorg
    
  3. Run this command in a terminal to deploy the app.

    sfdx force:source:deploy -p force-app
    
  4. Assign the Visualforce_to_LWC permission set to the default user.

    sfdx force:user:permset:assign -n Visualforce_to_LWC
    
  5. Import some sample data.

    sfdx force:data:tree:import -p ./data/sample-data-plan.json
    
  6. If your org isn't already open, open it now:

    sfdx force:org:open -u mydevorg
    
  7. In Setup, under Themes and Branding, activate the Visualforce to LWC theme.

  8. In App Launcher, select the Visualforce to LWC app.

Optional Installation Instructions

This repository contains several files that are relevant if you want to integrate modern web development tooling to your Salesforce development processes, or to your continuous integration/continuous deployment processes.

Code formatting

Prettier is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .prettierignore and .prettierrc files are provided as part of this repository to control the behavior of the Prettier formatter.

Code linting

ESLint is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .eslintignore file is provided as part of this repository to exclude specific files from the linting process in the context of Lighning Web Components development.

Pre-commit hook

This repository also comes with a package.json file that makes it easy to set up a pre-commit hook that enforces code formatting and linting by running Prettier and ESLint every time you git commit changes.

To set up the formatting and linting pre-commit hook:

  1. Install Node.js if you haven't already done so
  2. Run npm install in your project's root folder to install the ESLint and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.)

Note: This projects also contains Jest tests for unit testing Lightning Web Components. If you experience errors regarding deasync when running npm install please check out the troubleshooting information in the lwc-jest repository.

Prettier and ESLint will now run automatically every time you commit changes. The commit will fail if linting errors are detected. You can also run the formatting and linting from the command line using the following commands (check out package.json for the full list):

npm run lint
npm run prettier

Code Tours

Code Tours are guided walkthroughs that will help you understand the app code better. To be able to run them, install the CodeTour VSCode extension.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].