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

Component Generation #16

Merged
merged 44 commits into from
Sep 7, 2021
Merged

Conversation

plt-joey
Copy link
Contributor

@plt-joey plt-joey commented Jun 29, 2021

Create a separate project publishable as a dotnet tool for component generation.

Update 2021-07-01: Added samples for generation via string manipulation and generation via AST

Update 2021-08-20: Code complete and ready for first-pass reviews

NOTES TO REVIEWERS:

  • I made minor changes to Dash.NET itself that the generated components require to function. If you are testing a generated component in a dash app you have to point it at the version of Dash.NET in this PR, and not the one on nuget
  • For that same reason I have not added anything to the build scripts for publishing this tool yet, the updated version of Dash.NET has to be published first
  • Using the generated components also requires a minor change to the dash app template (!2), contentRoot needs to point to the build output, and not to the source code:
let contentRoot = Reflection.Assembly.GetExecutingAssembly().Location |> Path.GetDirectoryName

Rough todo list, in no particular order

  • Create new project based on existing BackboneGenerator.fsx
  • Refactor existing generator
    • Switch to AST based generation
    • Add property generation
    • Add property Enum and Union(?) type handling
    • Generate documentation
    • Switch components to Feliz-style instantiation (see !18)
    • Harden
  • Add:
    • Automatic component .js script loading on import/use
    • Project generation
    • Build pipeline generation
    • Nuget package definition generation
    • CLI
  • Parse information from metadata.json
    • Add support for flow types and ts types
  • Add package/publish steps for the dotnet tool
  • Automatic component publishing? (may want to separate this into a second task/PR)
  • Unit Tests
  • Fix Build Scripts
  • Documentation

@plt-joey plt-joey changed the title WIP: Component Generation Component Generation Aug 20, 2021
@plt-joey

This comment has been minimized.

@plt-joey plt-joey marked this pull request as ready for review August 20, 2021 17:11
@plt-joey

This comment has been minimized.

@plt-joey

This comment has been minimized.

@plt-joey

This comment has been minimized.

@plt-joey plt-joey force-pushed the component-generation branch from 664f2bb to c35618f Compare August 24, 2021 13:11
@plt-joey

This comment has been minimized.

@plt-joey

This comment has been minimized.

@plt-joey

This comment has been minimized.

@plt-joey

This comment has been minimized.

@kunjee17
Copy link

kunjee17 commented Sep 7, 2021

Looks good to me.

…e, some characters caused XML documentation to be invalid, '+' is not a valid character in DU case names
…tion, was causing more issues than it solved
@plt-joey plt-joey force-pushed the component-generation branch from a5ea70b to afaf467 Compare September 7, 2021 19:43
@plt-joey

This comment has been minimized.

@jackparmer jackparmer merged commit d884140 into plotly:dev Sep 7, 2021
| ObjectOf (_, Some value) ->
value
|> getTypePropDocumentation
|> Option.map (sprintf "dict with values of type: %s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dict -> record?

(apologies for the late comment, just poking around here to see how you implemented things)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in this case. ObjectOf is actually a Map, which is the F# version of IDictionary. I think I put dict here to be consistent with the python generator, but this technically should be Map.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it - just wanted to make sure this wasn't an unintended remnant from Python :)

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.

4 participants