-
Notifications
You must be signed in to change notification settings - Fork 30
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
[env/burn-staging] add new AnimateMap venue template #1617
Conversation
YarRainbow
commented
Jun 21, 2021
- The template was added following the example of the PartyMap.
- Added dependencies to the package.json
- Added venue reducer and another functions for work with redux-store
- Added basic objects for upcoming works in the canvas.
- Added vieports and quadtree for rendering objects
- Cuted out all demo data
prepare structure for AnimateMap data add settings for AnimateMap venue-item for creation venue page add stub for AnimateMap venue template
add quadtree for visualization static venue add LayerLOD with dynamic children
src/components/templates/AnimateMap/components/LayerLOD/GetItemsForRender.tsx
Show resolved
Hide resolved
src/components/templates/AnimateMap/components/LayerLOD/GetItemsForRender.tsx
Show resolved
Hide resolved
src/components/templates/AnimateMap/components/LayerLOD/GetItemsForRender.tsx
Show resolved
Hide resolved
Code Climate has analyzed commit 6340eae and detected 18 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Visit the preview URL for this PR (updated for commit 6340eae): https://co-reality-staging--preview-pr-1617-z2e7kshr.web.app (expires Mon, 05 Jul 2021 19:22:58 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
@YarRainbow Out of curiosity, was this PR originally opened targeting |
@0xdevalias sorry, I was late for the train and was in a hurry. All our branches forked from env/burn-staging and target on this branch. |
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.
Gave this a quick pass over to leave some comments/suggestions/pointers to help you align with how we do things, our codebase style, etc.
Learning about these things early on, and embedding them in your workflow will allow you to write code aligned to our standards from the very beginning, and will reduce the need for extra work/frustration/etc to try and align it later on.
Please share this among the rest of your engineering/dev team to ensure that everyone learns/benefits from the knowledge shared here.
Thanks.
(cc // @jonboutelle @sunny-viktoryia @mike-lvov FYI)
return ( | ||
<div ref={containerRef} className="animatemap-venue-container"> | ||
{container && ( | ||
<ReactReduxContext.Consumer> |
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.
Please use the redux hooks-based API: https://react-redux.js.org/api/hooks
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.
@0xdevalias I consulted with Vasily about his decision. We are facing a known issue with react-pixi. We only use this wrapper to patch the provider. And then we use only hooks according to your recommendations.
We can encapsulate the wrapper in a separate component, but we don't see a way to get rid of it entirely.
If you have an idea how to fix this, I will be glad to consider it.
PS pixijs/pixi-react#77
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.
Makes sense, thanks for the context. Following some of those links I ended up at this section of the README:
This links to the following React issue:
Which seems to have been closed by this PR:
Which seems to have been included in the React 16.6.0
changelog in this PR:
Since we seem to be using 16.13.1
, my guess/theory is that we should have that fix available to us:
I'm not really sure of the specifics of how this issue works, how it was fixed, or how that applies to the lib you're using here, but it would be good if you could quickly see if it is resolved in a 'proper' way now, and if so, align the code here to that 'proper' way.
If it's going to take too long/be too hard/etc, then can you add the following comment (replacing the XXX
's with the relevant details) just before the return
JSX so we have a note captured for future:
// @debt We need to use Redux's XXX here to work around a limitation in react-pixi-fibre as per:
// https://github.com/michalochman/react-pixi-fiber#react-context-api-limitations
//
// While this issue was resolved in React in v16.6.0 via facebook/react#13728, we can't use that
// fix here yet because XXX. Once that is resolved, we should refactor this accordingly.
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.
Also, if we still do need to hack around it like this, I wonder if we can still simplify/move the code here to a 'closer to Redux hooks' based implementation by making use of useStore
instead of ReactReduxContext.Consumer
, etc:
<Provider store={store}> | ||
{app ? <LoadingContainer /> : <Container />} | ||
</Provider> |
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.
Please use the redux hooks-based API: https://react-redux.js.org/api/hooks
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.
See this for potentially related reason why this isn't currently using hooks: #1617 (comment)
src/components/templates/AnimateMap/components/Common/Viewport.ts
Outdated
Show resolved
Hide resolved
RE: #1617 (comment)
@YarRainbow All good, didn't 'break anything' at all, more just confused me why that workflow ran. Thanks for letting me know the process you followed.. sounds like it might be something weird going on in our actions workflow then (might not be anything you've done 'wrong' with this PR at all). I'll make a mental note to look into it more later on and see if I can figure out the 'why' of it. Not something you need to look into. Thanks for the insight! :) For reference though, you probably shouldn't use that preview link at all, as it's connected to our main |
rename CSS classes, remove useless styles remove deprecated PIXI imports remove related path for some modules remove Object.Assign return tsconfig.json