pcf-limitations — GitHub Copilot rule: what it does, how to install
Instructs GitHub Copilot on Power Apps Component Framework restrictions. It prevents unsupported API calls and insecure storage patterns in PCF projects.
.github/instructions/pcf-limitations.instructions.mdWhat pcf-limitations does
This instruction targets code component files matching **/*.{ts,tsx,js,json,xml,pcfproj,csproj}. It prevents Copilot from writing code that calls Dataverse-dependent APIs, such as WebAPI, inside Canvas Apps. Those endpoints do not work in canvas applications.
The rule demands that external libraries are either bundled directly into the primary component package or replaced by platform React controls. It also forbids using window.localStorage and window.sessionStorage. Storing state in browser storage is insecure and lacks guaranteed persistence.
Custom authentication cannot be built directly into code components for Canvas Apps. Connectors must handle auth and data actions instead. Relying on custom auth routines will break the component during deployment.
What it helps with
- block unsupported Dataverse WebAPI calls in Canvas Apps
- prevent insecure data persistence in browser web storage
- enforce bundling of third-party libraries into primary component code
- route authentication through connectors instead of custom auth schemes
Example prompts for the agent
- Create a PCF control for Canvas Apps that retrieves list data
- Show me how to bundle an external npm package in pcfproj
- Store component state without using browser web storage
How to install pcf-limitations
Manually: put the files in place
.github/instructions/pcf-limitations.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.claude/rules/pcf-limitations.mdThe paths frontmatter field limits the files: move applyTo from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/pcf-limitations.mdcFrontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own
Manually: put the files in place
.devin/rules/pcf-limitations.mdManually: put the files in place
.clinerules/pcf-limitations.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about pcf-limitations
How to install pcf-limitations in GitHub Copilot?
Add the rule file to your repository at .github/instructions/pcf-limitations.instructions.md.
What does pcf-limitations do?
It teaches GitHub Copilot the restrictions of Power Apps Component Framework, blocking unsupported APIs in Canvas Apps and banning browser storage objects.
Why does the rule restrict window.localStorage?
The framework prohibits window.localStorage and window.sessionStorage because browser client storage is insecure and cannot guarantee reliable data availability.
Source text
pcf-limitations.instructions.md · MIT
---
description: 'Limitations and restrictions of Power Apps Component Framework'
applyTo: '**/*.{ts,tsx,js,json,xml,pcfproj,csproj}'
---
# Limitations
With Power Apps component framework, you can create your own code components to improve the user experience in Power Apps and Power Pages. Even though you can create your own components, there are some limitations that restrict developers implementing some features in the code components. Below are some of the limitations:
## 1. Dataverse Dependent APIs Not Available for Canvas Apps
Microsoft Dataverse dependent APIs, including WebAPI, are not available for Power Apps canvas applications yet. For individual API availability, see [Power Apps component framework API reference](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/).
## 2. Bundle External Libraries or Use Platform Libraries
Code components should either use [React controls & platform libraries](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/react-controls-platform-libraries) or bundle all the code including external library content into the primary code bundle.
To see an example of how the Power Apps command line interface can help with bundling your external library content into a component-specific bundle, see [Angular flip component](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/sample-controls/angular-flip-control) example.
## 3. Do Not Use HTML Web Storage Objects
Code components should not use the HTML web storage objects, like `window.localStorage` and `window.sessionStorage`, to store data. Data stored locally on the user's browser or mobile client is not secure and not guaranteed to be available reliably.
## 4. Custom Auth Not Supported in Canvas Apps
Custom auth in code components is not supported in Power Apps canvas applications. Use connectors to get data and take actions instead.
## Related Topics
- [Power Apps component framework API reference](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/)
- [Power Apps component framework overview](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/overview)
© github · MIT · github/awesome-copilot