4 ms·
Well, the animation under "Basic usage" at https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-select https://docs.microsoft.com/en-
by lstamour 6y ago
Well, the animation under "Basic usage" at https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-select https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps... highlights how the bar along the top changes based on what which button or control is selected. In turn, you can pick properties or events by name on the left (like "OnSelect" for when the button is clicked) and then type in a function that should run on the right, such as Notify(). You might think OnSelect is an odd name for an "OnClick" but it makes sense when you look at how many different types of controls could conceivably use "OnSelect" as a "primary action" of a control: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/properties-core https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps...
By comparison, with React or ReactiveX, you can do very similar things, but by default, complications creep in because of how the language works. In JavaScript, for instance, you have to worry about binding "this" for example: https://reactjs.org/docs/faq-functions.html https://reactjs.org/docs/faq-functions.html In ReactiveX, you have to think about how you're going to structure your code, and maybe even occasionally draw flow graphs.
I would also compare this to SwiftUI or Flutter, but more from the app layout perspective, where both platforms are much more mature than when they started. Here's an example comparing React and SwiftUI: https://blog.maximeheckel.com/posts/swiftui-as-react-developer https://blog.maximeheckel.com/posts/swiftui-as-react-develop... One could imagine a meta-article that compares Power-Fx to SwiftUI to Flutter, etc. Actually ... I went hunting for how state works in Flutter, and it's remarkably complicated, showing perhaps that languages which are free to evolve can maybe iterate to better solutions faster: https://flutter.dev/docs/get-started/flutter-for/react-native-devs#what-are-the-statefulwidget-and-statelesswidget-best-practices https://flutter.dev/docs/get-started/flutter-for/react-nativ...
To that end, I'd look forward to seeing more projects and languages adopt the "automatic code upgrade" approaches widely seen in Xcode, React/JS codemods, and here, in Power-Fx. The idea that somebody has mapped a conversion from "the old way of doing things" to "the new way" is really convenient when the language can support it.
I'd be interested to see if Power-Fx might expand to automated test cases -- wait, apparently that's a thing for Power Apps: https://powerapps.microsoft.com/en-us/blog/introducing-test-studio-to-build-end-to-end-tests-and-maintain-your-app-quality/ https://powerapps.microsoft.com/en-us/blog/introducing-test-... It maybe needs a bit more usability improvement. It would be amazing if it behaved like Redux such that you could scroll through your test playback and maybe even view or add assertions at different steps or if it supported automatic "snapshots" of visual appearance or view state, perhaps like Jest. Theoretically, you could run a test step twice (or more, such as when fuzzing) and if its output changes, mark that section visibly as dynamic or "to be ignored/fixed later" (kind of how Bazel can warn on non-deterministic build steps). If a function loads remote data, maybe it could also be a suggested snapshot for the test, and once you've a snapshot of loaded data, you could experiment with automatic fuzzing. There's a lot of potential in testing functional UI that could improve apps and even inspire tools for other, more traditional languages and frameworks...
Thinking about testing tools, I suddenly had other ideas: What if you gave Power-Fx an input, an output, and then had it suggest what combinations of functions might produce that result? I'd imagine it would be more of a learning tool, but it could be interesting. Similarly, for education or understanding complicated functions, maybe there's a "debugger" mode where you could hover over any part of the function and it would tell you the value of that part of the function, given the view's current state/input, kind of like how Excel highlights cells that store data? Or to automatically convert a function into an English text representation that might be 5-10 sentences but would use existing data/context to explain itself? That way you could follow the flow of the function the way some regular expressions tools help you understand what's going on in a complicated regex expression/function, for example.
- nyanpasu64 6y agoI don't see what your child comment has to do with my parent comment. - You brought up "OnSelect" and binding "this" in JS, but they don't seem related to picking one way to propagate state through a GUI (either "push", "pull" (signals and slots), pseudo-immediate-mode and state diffing (React), FRP, property binding, ReactiveX, or something else). - https://blog.maximeheckel.com/posts/swiftui-as-react-developer https://blog.maximeheckel.com/posts/swiftui-as-react-develop... does discuss state, but you brought it up in the context of app layout. App layout is another area with multiple choices, but it's more linked to visual design, and less to functional correctness (which is vulnerable to state-propagation bugs which I was talking about). - Automated code updates, and test generation, are not related either.