You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -508,6 +508,74 @@ WHERE Name LIKE 'a%'
508
508
OR Name LIKE 'c%'
509
509
```
510
510
511
+
## Using in LWC
512
+
513
+
The easiest way to utilize this library in LWC is to deploy the compiled code as a web component in your org.
514
+
515
+
:warning: The minified version ends up with `$A` characters in the output, which causes the deployment to SFD to fail, so we have created an unminified version of the library just for Salesforce.
516
+
517
+
### Obtaining the build artifacts
518
+
519
+
We don't store the built artifacts on github, so you will need to obtain from NPM or run the build command yourself.
520
+
521
+
#### Download from NPM
522
+
523
+
Download from [npm](https://www.npmjs.com/package/@jetstreamapp/soql-parser-js)
524
+
525
+
**Either:**
526
+
527
+
1. Go to the "Code Tab"on the [npm](https://www.npmjs.com/package/@jetstreamapp/soql-parser-js) listing
528
+
1. Navigate to `/dist/lwc.index.mjs`
529
+
2. Install this project in an existing node library by running `npm install @jetstreamapp/soql-parser-js`
530
+
1. then navigating to the downloaded code in this folder: `node_modules/@jetstreamapp/soql-parser-js/dist/lwc`
531
+
532
+
#### Build the files yourself
533
+
534
+
1. Clone/download the repository from GitHub
535
+
2. Ensure you have node installed (version 22or higher)
536
+
3. Install dependencies with `npm install`
537
+
4. Run `npm build:lwc`
538
+
5. The output will be placed in`/dist/lwc.index.mjs`
539
+
540
+
### Deploying and Using in Salesforce
541
+
542
+
Copy `index.mjs` into an LWC component.
543
+
544
+
For example:
545
+
546
+
```
547
+
soqlParserJsLib
548
+
- soqlParserJsLib.js <--- copy the code here
549
+
- soqlParserJsLib.js-meta.xml
550
+
```
551
+
552
+
After you have deployed the LWC, you can import it just like any other LWC import.
553
+
554
+
```js
555
+
import { LightningElement } from 'lwc';
556
+
import { parseQuery } from 'c/soqlParserJsLib';
557
+
558
+
export default class SoqlParserJs extends LightningElement {
0 commit comments