microsoft / microsoft/BotFramework-WebChat
Investigate: `regeneratorRuntime` not working in strict mode
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
Version
4.10.1
Describe the bug
When using Salesforce Lightning Locker, it said regeneratorRuntime violated "no global" rule.
The Locker Service Console can be used for quick diagnosing issues.
Steps to reproduce
- Go to Salesforce Locker Service Console
- Enable both "Locker" and "Strict CSP"
- Copy and paste
webchat.js - Click "Evaluate"
Expected behavior
It should give green light.
Additional context
Currently, the regeneratorRuntime is set to global (a.k.a. pollution). We should find a switch or some ways to scope it to local (inside the module).
Investigator should also check if Locker Service Console is available to use in CI, so we can run it on-demand when we produce a new build.
StackOverflow related question, https://stackoverflow.com/questions/58385471/get-rid-of-regeneratorruntime-is-not-defined-without-importing-the-polyfill.
pdf.js also violated the same rule, https://salesforce.stackexchange.com/questions/285052/i-cant-load-pdf-js-lib-in-lightning-web-component.
Related issue, https://github.com/microsoft/BotFramework-DirectLineJS/issues/312.
After we found a solution, we should propagate the result to SDK and DLJS.
Running Salesforce Lightning linter
The linting tool requires our JS bundle to put inside an Aura component. The CLI below need some refinements.
npm install --global sfdx-cli
sfdx force:lightning:component:create -n webchat
cp webchat*.js /aura/webchat/
sfdx force:lightning:lint .
[Bug]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated webchat.js bundle and reproduce the issue in the Salesforce Locker Service Console with Locker and Strict CSP enabled. Review the sfdx Lightning component and linting commands described in the issue, and determine whether the console can run in CI. Done means regeneratorRuntime is scoped locally and the result can be propagated to the SDK and DLJS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100