{"id":20247732,"url":"https://github.com/trailheadapps/visualforce-to-lwc","last_synced_at":"2025-04-12T22:37:12.476Z","repository":{"id":38845631,"uuid":"272735494","full_name":"trailheadapps/visualforce-to-lwc","owner":"trailheadapps","description":"A collection of code examples to help you move from Visualforce to LWC.","archived":false,"fork":false,"pushed_at":"2025-04-01T08:15:21.000Z","size":1855,"stargazers_count":130,"open_issues_count":6,"forks_count":98,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-04T02:08:17.704Z","etag":null,"topics":["lightning-web-components","salesforce","visualforce"],"latest_commit_sha":null,"homepage":"https://developer.salesforce.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trailheadapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T14:49:56.000Z","updated_at":"2025-04-01T08:14:22.000Z","dependencies_parsed_at":"2023-02-17T09:01:30.658Z","dependency_job_id":"a680f42c-ca73-43eb-a0cf-454b1915ce98","html_url":"https://github.com/trailheadapps/visualforce-to-lwc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailheadapps%2Fvisualforce-to-lwc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailheadapps%2Fvisualforce-to-lwc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailheadapps%2Fvisualforce-to-lwc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailheadapps%2Fvisualforce-to-lwc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trailheadapps","download_url":"https://codeload.github.com/trailheadapps/visualforce-to-lwc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643006,"owners_count":21138353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lightning-web-components","salesforce","visualforce"],"created_at":"2024-11-14T09:39:08.243Z","updated_at":"2025-04-12T22:37:12.459Z","avatar_url":"https://github.com/trailheadapps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visualforce to LWC\n\n[![CI Workflow](https://github.com/trailheadapps/visualforce-to-lwc/workflows/CI/badge.svg)](https://github.com/trailheadapps/visualforce-to-lwc/actions?query=workflow%3ACI) [![Packaging Workflow](https://github.com/trailheadapps/visualforce-to-lwc/workflows/Packaging/badge.svg)](https://github.com/trailheadapps/visualforce-to-lwc/actions?query=workflow%3APackaging) [![codecov](https://codecov.io/gh/trailheadapps/visualforce-to-lwc/branch/main/graph/badge.svg)](https://codecov.io/gh/trailheadapps/visualforce-to-lwc)\n\n![Visualforce to LWC logo](vf-to-lwc-logo.png)\n\nA 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.\n\n\u003cdiv\u003e\n    \u003cimg src=\"https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70,w_50/learn/projects/quick-start-explore-the-visualforce-to-lwc-sample-app/9e3d54bf2af4e57a3581ed6c2386b473_badge.png\" align=\"left\" alt=\"Trailhead Badge\"/\u003e\n    Learn more about this app by completing the \u003ca href=\"https://trailhead.salesforce.com/en/content/learn/projects/quick-start-explore-the-visualforce-to-lwc-sample-app\"\u003eQuick Start: Explore the Visualforce to LWC Sample App\u003c/a\u003e Trailhead project.\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n\u003c/div\u003e\n\n## Table of contents\n\n-   [Installing Visualforce to LWC Using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.\n\n-   [Installing Visualforce to LWC Using an Unlocked Package](#installing-the-app-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.\n\n-   [Installing Visualforce to LWC using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.\n\n-   [Optional installation instructions](#optional-installation-instructions)\n\n-   [Code tours](#code-tours)\n\n## Installing the app using a Scratch Org\n\n1. Set up your environment. Follow the steps in the [Quick Start: Lightning Web Components](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/) Trailhead project. The steps include:\n\n    - Enable Dev Hub in your Trailhead Playground\n    - Install Salesforce CLI\n    - Install Visual Studio Code\n    - Install the Visual Studio Code Salesforce extensions\n\n1. If you haven't already done so, authorize with your hub org and provide it with an alias (**myhuborg** in the command below):\n\n    ```\n    sf org login web -d -a myhuborg\n    ```\n\n1. Clone the visualforce-to-lwc repository:\n\n    ```\n    git clone https://github.com/trailheadapps/visualforce-to-lwc\n    cd visualforce-to-lwc\n    ```\n\n1. Create a scratch org and provide it with an alias (**visualforce-to-lwc** in the command below):\n\n    ```\n    sf org create scratch -d -f config/project-scratch-def.json -a visualforce-to-lwc\n    ```\n\n1. Push the app to your scratch org:\n\n    ```\n    sf project deploy start\n    ```\n\n1. Assign the **Visualforce_to_LWC** permission set to the default user:\n\n    ```\n    sf org assign permset -n Visualforce_to_LWC\n    ```\n\n1. (Optional) Assign the `Walkthroughs` permission set to the default user.\n\n    \u003e 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.\n\n    ```\n    sf org assign permset -n Walkthroughs\n    ```\n\n1. Import sample data:\n\n    ```\n    sf data tree import -p ./data/sample-data-plan.json\n    ```\n\n1. Open the scratch org:\n\n    ```\n    sf org open\n    ```\n\n1. In **Setup**, under **Themes and Branding**, activate the **Visualforce to LWC** theme.\n\n1. In App Launcher, click View all then select the **Visualforce to LWC** app.\n\n## Installing the app using an Unlocked Package\n\nFollow 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](https://developer.salesforce.com/signup) or a [Trailhead Playground](https://trailhead.salesforce.com/).\n\nMake sure to start from a brand-new environment to avoid conflicts with previous work you may have done.\n\n1. Log in to your org\n\n1. Click [this link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t3h0000046N4MAAU) to install the Visualforce to LWC unlocked package in your org.\n\n1. Select **Install for All Users**\n\n1. Import Account and Contacts data:\n\n    - Click [here](https://raw.githubusercontent.com/trailheadapps/visualforce-to-lwc/main/data/Accounts-Contacts.csv) to acccess the **Accounts-Contacts.csv** file. Right click in the browser window and save the file as **Accounts-Contacts.csv**.\n    - In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.\n    - Click **Launch Wizard**.\n    - Click **Accounts and Contacts**, and click **Add New Records**.\n    - Select **Match Account by: Name \u0026 Site**.\n    - Drag the **Accounts-Contacts.csv** file you just saved to the upload area.\n    - Click **Next**, **Next**, and **Start Import**.\n\n1. If you're attempting the [Quick Start](https://trailhead.salesforce.com/en/content/learn/projects/quick-start-visualforce-to-lwc-sample-app) on Trailhead, this step is required, but otherwise, skip:\n\n    - Go to **Setup \u003e Users \u003e Permission Sets**.\n    - Click **Visualforce_to_LWC**.\n    - Click **Manage Assignments**.\n    - Check your user and click **Add Assignments**.\n\n1. In **Setup**, under **Themes and Branding**, activate the **Visualforce to LWC** theme.\n\n1. In App Launcher, click View all then select the **LWC** app.\n\n## Installing the App using a Developer Edition Org or a Trailhead Playground\n\nFollow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org.\nThis includes non source-tracked orgs such as a [free Developer Edition Org](https://developer.salesforce.com/signup) or a [Trailhead Playground](https://trailhead.salesforce.com/).\n\nMake sure to start from a brand-new environment to avoid conflicts with previous work you may have done.\n\n1. Clone this repository:\n\n    ```\n    git clone https://github.com/trailheadapps/visualforce-to-lwc\n    cd visualforce-to-lwc\n    ```\n\n1. Authorize with your Trailhead Playground or Developer org and provide it with an alias (**mydevorg** in the command below):\n\n    ```\n    sf org login web -s -a mydevorg\n    ```\n\n1. Run this command in a terminal to deploy the app.\n\n    ```\n    sf project deploy start -d force-app\n    ```\n\n1. Assign the `Visualforce_to_LWC` permission set to the default user.\n\n    ```\n    sf org assign permset -n Visualforce_to_LWC\n    ```\n\n1. Import some sample data.\n\n    ```\n    sf data tree import -p ./data/sample-data-plan.json\n    ```\n\n1. If your org isn't already open, open it now:\n\n    ```\n    sf org open -o mydevorg\n    ```\n\n1. In **Setup**, under **Themes and Branding**, activate the **Visualforce to LWC** theme.\n\n1. In App Launcher, select the **Visualforce to LWC** app.\n\n## Optional Installation Instructions\n\nThis 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.\n\n### Code formatting\n\n[Prettier](https://prettier.io/) is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) from the Visual Studio Code Marketplace. The [.prettierignore](/.prettierignore) and [.prettierrc](/.prettierrc) files are provided as part of this repository to control the behavior of the Prettier formatter.\n\n\u003e **Warning**\n\u003e The current Apex Prettier plugin version requires that you install Java 11 or above.\n\n### Code linting\n\n[ESLint](https://eslint.org/) is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-lwc) from the Visual Studio Code Marketplace. The [.eslintignore](/.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.\n\n### Pre-commit hook\n\nThis repository also comes with a [package.json](./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.\n\nTo set up the formatting and linting pre-commit hook:\n\n1. Install [Node.js](https://nodejs.org) if you haven't already done so\n1. 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.)\n\n\u003e Note: This projects also contains [Jest](https://jestjs.io) 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](https://github.com/salesforce/lwc-jest#troubleshooting-deasync-installation-errors).\n\nPrettier 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](./package.json) for the full list):\n\n```\nnpm run lint\nnpm run prettier\n```\n\n## Code Tours\n\nCode Tours are guided walkthroughs that will help you understand the app code better. To be able to run them, install the [CodeTour VSCode extension](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailheadapps%2Fvisualforce-to-lwc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrailheadapps%2Fvisualforce-to-lwc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailheadapps%2Fvisualforce-to-lwc/lists"}