-
Notifications
You must be signed in to change notification settings - Fork 113
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
[KED-2470] Add Container component to simplify app/lib entrypoint #379
Conversation
1. Create new Container component, and move a lot of the logic for the app entrypoint to it, in order to keep src/index.js as simple as possible. 2. Move the 'what-input' import to the App component - it should have been there to begin with. 3. Move the global app styles from src/styles.index.scss to Container component, as they are most related to this component. 4. Change import order in App component - cosmetic change to ensure that absolute imports come first. 5. Add better explanation in App/Container JSDoc comments
import './app.css'; | ||
|
||
/** | ||
* Main wrapper component. Intialises the Redux store | ||
* Entry-point component for the use-case where Kedro-Viz is imported as a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newer component is good as it explains the use case for this component 👍
* Top-level component for the use-case where Kedro-Viz is run as a standalone | ||
* app rather than imported as a library/package into a larger application. | ||
*/ | ||
const Container = () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: I might've preferred to call AppContainer
just to allow this to be more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe even KedroViz
as that's the alias being used? Makes sense based on intended usage, since that's the public component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a good shout! I'm inclined to leave it for now because we'll be revisiting/refactoring this when we deprecate the library/package use-case, but can revisit if you feel strongly about it :)
# Release 3.10.0 ## Major features and improvements - Display a prompt before rendering very large graphs (#361, #376, #377, #381) ## Bug fixes and other changes - Clean up SCSS tech debt (#380) - Add Container component to simplify app/lib entrypoint (#379) - Add stylelint 'rule-empty-line-before': 'always' (#378)
Description
Container
component, and move a lot of the logic for the app entrypoint to it, in order to keep src/index.js as simple as possible. This should help make it easier to understand the different entrypoints for the app/lib use-cases.Development notes
The only functionality change is that focus highlights should work in app imports now - I don't think they would have before.
I wasn't sure about the 'Container' component name, but I wasn't sure what else to call it. 'KedroViz'? 'AppContainer' and 'LibContainer'? I think it works for now with the comments I've added. Besides, this is all fairly temporary, no need to spend too much time scrutinising it.
QA notes
Check both lib/app usages.
Checklist
RELEASE.md
fileLegal notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":
I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.