Power Fx low-code programming language
Перейти к файлу
Akshar V Patel 6c4014b371
Adding ability to supply custom binding config to Engine.ComputeBinding() & Fixing Dup String Interp Tokens bug (#1531)
This pr handles few things that are mentioned below:
1) It adds a new virtual overload of `GetDefaultBindingConfig` in
Engine.cs that takes in ParserOptions and optional rule scope and
returns a binding config that is used by `Engine.ComputeBinding()`. This
is done so that Power Apps can supply custom binding config for semantic
tokenization. Power Apps never set
`BindingConfig.UseThisRecordForRuleScope` to true but changes before
this pr calculated the value of
`BindingConfig.UseThisRecordForRuleScope` based on the value returned
from `Engine.GetRuleScope()`. It would be true when GetRuleScope()
returns a non null value. There are properties such as `OnErrors `on
AppInfo control in PowerApps that returns a non null value for
`GetRuleScope()`. In this case,` useThisRecordForRuleScope `would be
true in` Engine.ComputeBinding() `but it should never be true when
`Engine.ComputeBinding() `is run from PowerApps.

2) This pr fixes a bug where duplicate string interpolation and island
tokens were added when expression has nested string interpolation to the
list of tokens returned from Tokenization.Tokenize. This pr fixes that
logic and adds tests to validate it. A good example of this bug is an
expression like `$"{$"{$"{$"{.12e4}"}"}"}"`. The number of tokens should
be 17 but it is 41. Many of them are duplicate with same spans and token
types.

3) This pr also fixes one test that happened due to Visual Studio
picking up a different line feed for C# multiline strings `@""` .
Updates the test to avoid using multiline string. @gregli-msft is the
only and first one so far to face this problem. Tests were failing for
him. Confirmed with him that avoiding multiline string fixes the test.
2023-05-31 22:12:52 -04:00
.github Add CodeOwners files (#1468) 2023-05-02 14:39:04 +02:00
.scripts Optimize function lookup (#1019) 2023-02-23 16:14:37 +01:00
docs Correct grammar production for ‘IdentiferName’ (#26) 2022-04-07 23:49:25 -07:00
src Adding ability to supply custom binding config to Engine.ComputeBinding() & Fixing Dup String Interp Tokens bug (#1531) 2023-05-31 22:12:52 -04:00
.editorconfig Tweak 2 editor rules. (#966) 2023-01-06 14:30:31 +01:00
.gitignore Update API compatibility logic (#934) 2022-12-22 18:41:33 +01:00
ApiCompat.Files.xml Update API compatibility logic (#934) 2022-12-22 18:41:33 +01:00
ApiCompatBaseline.txt API compatibility validation improvements, PowerFx (#707) 2022-10-04 16:13:10 -07:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2021-02-23 14:09:21 -08:00
LICENSE Initial LICENSE commit 2021-02-23 14:09:22 -08:00
README.md Update doc links to nightly build nuget feed (#1053) 2023-02-02 00:05:06 -08:00
SECURITY.md Initial SECURITY.md commit 2021-02-23 14:09:24 -08:00
SUPPORT.md Spelling (#6) 2022-04-07 13:20:51 -07:00
dailyBuilds.md Update doc links to nightly build nuget feed (#1053) 2023-02-02 00:05:06 -08:00

README.md

Microsoft Power Fx

PowerFX usage example, displaying a simple slider

Microsoft Power Fx is a low-code general purpose programming language based on spreadsheet-like formulas. It is a strongly typed, declarative, and functional language, with imperative logic and state management available as needed.

Power Fx started with Power Apps canvas apps and that is where you can experience it now. We are in the process of extracting the language from that product so that we can use it in more Microsoft Power Platform products and make it available here for you to use. That's going to take some time and we will report on our progress here and on the Power Apps blog.

A start on the language documentation is available in the docs folder. As with the implementation, it is being extracted from the Power Apps documentation and generalized and that too is going to take some time.

Summary

Overview

PowerFX overview video thumbnail For those new to Power-Fx, this video should answer many of your questions:
Power Fx: the Programming Language for Low Code and what it means for Developers

Build Status

Branch Description Build Status Coverage Status Test Status
Main 0.2.* Preview Builds Build Status Coverage Status Tests Status

Packages

Name Released Package
Microsoft.PowerFx.Core BotBuilder Badge
Microsoft.PowerFx.Core.Tests
Microsoft.PowerFx.Interpreter BotBuilder Badge
Microsoft.PowerFx.Transport.Attributes BotBuilder Badge

Daily Builds

Daily builds of the Power Fx packages are published to Azure Artifacts.

https://pkgs.dev.azure.com/Power-Fx/7dd30b4a-31be-4ac9-a649-e6addd4d5b0a/_packaging/PowerFx/nuget/v3/index.json

Samples

There are samples demonstrating how to consume Power Fx at: https://github.com/microsoft/power-fx-host-samples

You can also see usage examples in the unit tests.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.