Skip to content
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

[WIP] MUI v5 update #87

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

[WIP] MUI v5 update #87

wants to merge 61 commits into from

Conversation

ArtemyB
Copy link

@ArtemyB ArtemyB commented Oct 8, 2022

Issues covered: #84 and #85.

Took @Linschlager's mui-v5 branch as a starting point and finally got a more or less complete MUI v5 bindings - at least the docs-app is already working (there is a published version here). Except that I've started using this new version in some of my personal projects. For now all works fine, but as bugs will arise, I'll be making proper fixes.

Lots of components have not been tested/used completely yet, that's why it's WIP and the version marked as alpha. One of the major changes -- there are separate packages for MUI X DatePickers (both community and pro) and Material Icons. At the moment I've published NuGet-packages only to my GitHub feed - see my fork of the repo.

Linschlager and others added 30 commits January 11, 2022 19:22
- Fixed the tool to account for the new bugs in the docs
- Ran the generator over the newer docs
- Updated the links to account for the legacy status
…S v17+, updated NuGet-packages and dotnet-tools, small fix of build.fsx to get rid of compile-time errors.
…rors in generated code). Includes bindings for MUI-Core/Material-UI and MUI-X/Date-Pickers. Docs-app runs with new MUI v5, but lacks proper theming - theming API bindings needs fixing.

Details:
- Updated docs HTML's cache - directory structure changed according to new MUI docs structure.
- Changes in all projects except Feliz.Generator.
- Fixed Docs project to make it run with new MUI v5 bindings, Webpack 5, pnpm and Fable 3 dotnet tool.
- For docs project: updated Webpack to v5.
- Updated packages (NuGet and NPM).
- Changed .editorconfig to indent size 4 and added some configs for Fantomas.
- Reformatted most of the code (to indent size of 4) - except Feliz.Generator project and Feliz.MaterialUI's auto-generated code.
… MUI v5).

[Docs App]: Packages moved to separate Paket group, updated FSharp.Core to 6.0.5, updated Elmish to 4.0.0-beta3. + Some minor fixes.
…lz.MaterialUI.Icons project. Removed package.json.lock - replaced by pnpm-lock.yaml.
…d.fsx" script. Actualized build pipeline in it (build.fsx was not updated and may not work properly).
…s done via FParsec recursively, being translated into intermediate AST (TsType DU). Then this AST is translated into PropOverload (Regular or Enum), used by Feliz.Generator. For now this translation is used only for "componentProps" prop as a replacement for a naive, non-recursive core-lib-based approach, that doesn't handle complex type signatures.
… be some redundant special case handlings, however generated bindings has no compile-time errors and the Docs App is still working properly.

- Added handling of more doc type signature cases: "HTML element", "element type", bool and int literal.
- Fixed root doc type parser application order.
- Moved doc type signature literal cases to a separate DU in AST.
- Added missing NPM-packages (date-fns, @mui/x-date-pickers, @mui/system).
- MUI X DatePickers moved to the separate projects: Feliz.MuiX.DatePickers and Feliz.MuiX.DatePickersPro.
- FIxed some API translation cases (mostly for DatePickers). Updated DocsApp a little bit, e.g. added a simple example of DateTimePicker usage.
- Some refactorings (including the ones needed for a separate DatePickers API translation).
Now 2 kinds of files are generated: "ClassNames.fs" with component global classes names (MuiClasses module) and "ClassesProps.fs" for compnent "classes" prop (as in MUI v4).
…ed package-projects to include versions, slightly actualized ReadMe-files, added new Release-Notes entry.
- Grid's "container" and "item" props special handling as property instead of method (returns "true" value of the prop).
- "Unstable_Grid2" component added (without props -- Grid component props can be used).
- Added special case for "number"-props: `int` and `float` overloads are generated.
… generated via ts2fable with small fixes to make them compile)
…-object and callback with OwnerState are expected for the component slot, the F# api will take only seq<IReactProperty> (further transformed into object).
…d to ReactElementType). Put into "MuiComponents" type.
…ponent binding. Removed StylesProvider component (for being obsolete in MUI 5).
…finition to address recent FCS updates that makes the old definition incompilable (e.g. by Fable v4.0.0-theta-018).
@ArtemyB ArtemyB marked this pull request as ready for review February 15, 2023 19:30
@ArtemyB
Copy link
Author

ArtemyB commented Feb 15, 2023

Some notes:

  • Current bindings are relevant for MUI v5.10.*. So they could have some inconsistencies with MUI v5.11+ - haven't checked what exactly and how many of them there are.
  • The libraries still depend on Feliz v1, so according to this issue there will be compiler errors when using with Feliz >= 2 and/or Fable.React >= 9.

- Update MUI to v5.11.9 (latest stable), MUI Lab to 5.0.0-alpha.120, MUI X Date-Pickers to 5.0.18; and regenerate bindings.
- Adjust ApiParser to handle new `slotProps` prop (future replacement for `componentsProps`).
-  Bump Feliz.MaterialUI to v5.11.0-beta.0, Feliz.MuiX.DatePickers and Feliz.MuiX.DatePickersPro to v5.0.0-beta.0
- Docs-App: update Fable to 4.0.0-theta-018 and add/update some NuGet packages (Feliz.CompilerPlugins, Fable.Core, Feliz.UseElmish, Feliz.Router).
- Update dependencies to reflect Feliz 2+ and Fable.React 9+ requirements.
- Bump versions to: Feliz.MaterialUI 5.11.0-beta.1, Feliz.MaterialUI.Icons 5.10.0-beta.1, Feliz.MuiX.DatePickers 5.0.0-beta.1, Feliz.MuiX.DatePickersPro 5.0.0-beta.1.
- Update `react` NPM-package to v18, add `usy-sync-external-store` NPM-package (required by `Feliz.UseElmish v2+`).
- Docs-App: make proper fixes  to make the app work with Feliz 2+ and Fable.React 9+.
@ArtemyB
Copy link
Author

ArtemyB commented Mar 1, 2023

Updated to Feliz >= 2 (and Fable.React >= 9), regenerated bindings for MUI v5.11. Seems like there are no critical changes -- the only noticeable one is a new prop slotProps, which is for now just an alias for componentsProps, but later it will be removed in favor of the new one. NuGet packages are also published to my GitHub-feed as before.

ArtemyB added 4 commits June 21, 2023 22:47
- Bump `Feiz.MaterialUI` to v5.11.0-beta.3.
- Update Release Notes.

closes #5
- Add `circularProgress`'s `size` and `skeleton`'s `height` and `weight` prop overloads accepting `string` value.
… FCS bug

Resolves (as a workaround) the following Fable issue: fable-compiler/Fable#3752
The solution is to make all the big modules (with a lot of bindings) recursive (i.e., mark them with `rec` modifier). The workaround is taken from the originating F# issue: dotnet/fsharp#17415

Update Fable .NET tool version to `4.19.3`.

Bump package versions:
- Feliz.MaterialUI to v5.11.0-beta.4
- Feliz.MaterialUI.Icons to v5.10.0-beta.3
- Feliz.MuiX.DatePickers to v5.0.0-beta.3
- Feliz.MuiX.DatePickersPro to v5.0.0-beta.3

closes #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants