Skip to content

feat: file-templates as array in React render engine - #518

Merged
magicmatatjahu merged 12 commits into
asyncapi:masterfrom
magicmatatjahu:react-file-templates-array
Mar 4, 2021
Merged

feat: file-templates as array in React render engine#518
magicmatatjahu merged 12 commits into
asyncapi:masterfrom
magicmatatjahu:react-file-templates-array

Conversation

@magicmatatjahu

@magicmatatjahu magicmatatjahu commented Mar 1, 2021

Copy link
Copy Markdown
Member

Description

  • Render an array of File component from React render engine - file templates feature.
  • Add documentation for new feature.
  • Add unit tests for React.
  • Increase timeout in tests to 2m :(

Docs part:

React

The above way of rendering file templates works for both nunjucks and react render engine, but react also has another, more generic way to render multiple files. It is enough to return an array of File components in the rendering component. Check example:

export default function({ asyncapi }) {
  return [
    <File name={`file1.html`}>Content</File>,
    <File name={`file2.html`}>Content</File>
  ]
}

Related issue(s)
Part of asyncapi-archived-repos/generator-react-sdk#10

@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Mar 1, 2021

@jonaslagoni jonaslagoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some small comments. In hindsight, I should have added tests for the renderer when first integrating the feature. Gonna create a follow up issue about that.

Comment thread docs/authoring.md Outdated
Comment thread docs/authoring.md
Co-authored-by: Jonas Lagoni <jonas-lt@live.dk>
@sonarqubecloud

sonarqubecloud Bot commented Mar 2, 2021

Copy link
Copy Markdown

Please retry analysis of this Pull-Request directly on SonarCloud.

@jonaslagoni

Copy link
Copy Markdown
Member

@magicmatatjahu you have a problem with SonarCloud 😄

@derberg

derberg commented Mar 2, 2021

Copy link
Copy Markdown
Member

@magicmatatjahu will you also do a follow-up in the template for templates, to use this new way for file templates?

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@derberg Of course, I will, but I wanna wait for merge your PR to write tests for an array of Files - your PR has architecture for tests.

@jonaslagoni

Copy link
Copy Markdown
Member

@magicmatatjahu you have a little problem with checks 😄

@derberg

derberg commented Mar 3, 2021

Copy link
Copy Markdown
Member

@magicmatatjahu you need to increase timeouts in the test project tests to a larger number, these tests are really long-running :(

@magicmatatjahu
magicmatatjahu requested review from jonaslagoni and removed request for jonaslagoni March 3, 2021 16:02
jonaslagoni
jonaslagoni previously approved these changes Mar 4, 2021

@jonaslagoni jonaslagoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

jonaslagoni
jonaslagoni previously approved these changes Mar 4, 2021
@sonarqubecloud

sonarqubecloud Bot commented Mar 4, 2021

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@magicmatatjahu
magicmatatjahu merged commit f92fabf into asyncapi:master Mar 4, 2021
@magicmatatjahu
magicmatatjahu deleted the react-file-templates-array branch March 4, 2021 11:34
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants