-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[doc] TargetableModule.spliceSource() examples and debugging instructions #3168
Conversation
|
| `before` | string | Code changes are applied at the start of this string in the code | | ||
| `after` | string | Code changes are applied to the end of this string in the code | | ||
|
||
Instruction objects can only have **one** location property (`at`, `before`, `after`), but one or both action properties (`insert`, `remove`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good note; this wouldn't necessarily be obvious.
### Splice code using instructions | ||
|
||
The `spliceSource()` function is a low level code modification function that apply changes based on an instruction object. | ||
The `insertAfterSource()`, `insertBeforeSource()`, and `prependSource()` functions provide a simpler interface and are [facade functions][] for `spliceSource()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to recommend the sweeter syntax. 👍
Description
Adds examples for using the
TargetableModule.spliceSource()
function as well as debugging instructions.Related Issue
Closes PWA-1710 and Closes #3155
Acceptance
Any core developer
@Jordaneisenburger (optional)
Verification Stakeholders
Any core developer
@Jordaneisenburger (optional)
Specification
Verification Steps
cd pwa-devdocs
yarn develop
/pwa-buildpack/reference/targetables/TargetableModule/
Screenshots / Screen Captures (if appropriate)
Checklist