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

Migration to React three fiber #775

Merged
merged 40 commits into from
Oct 11, 2023
Merged

Conversation

Angatupyry
Copy link
Collaborator

What's new

Migration to React three fiber

  • Remove all react leaflet component
  • Using react three fiber instead.

Pending:

  • Labels overlapping.
  • Some hardcode z and scales values
  • Test from new react components
  • It still happening that something the image doesn't load correctly and the frontend crash. I couldn't reproduce it properly yet.
  • Issue related Migrate react leaflet to react three fiber. #734
Screencast.from.09-19-2023.07.41.42.PM.webm

Self-checks

  • I have prototyped this new feature (if necessary) on Figma
  • I'm familiar with and follow this Typescript guideline
  • I added unit-tests for new components
  • I tried testing edge cases
  • I tested the behavior of the components that interact with the backend, with an e2e test

Discussion

Signed-off-by: angatupyry <fierrofenix@gmail.com>
…x component noise

Signed-off-by: angatupyry <fierrofenix@gmail.com>
…x component noise

Signed-off-by: angatupyry <fierrofenix@gmail.com>
…x component noise

Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #775 (5a39c12) into main (c885e3d) will decrease coverage by 2.72%.
Report is 8 commits behind head on main.
The diff coverage is 5.17%.

@@            Coverage Diff             @@
##             main     #775      +/-   ##
==========================================
- Coverage   53.92%   51.21%   -2.72%     
==========================================
  Files         263      281      +18     
  Lines        6639     7055     +416     
  Branches      882      948      +66     
==========================================
+ Hits         3580     3613      +33     
- Misses       2919     3299     +380     
- Partials      140      143       +3     
Flag Coverage Δ
dashboard 16.48% <0.00%> (-1.40%) ⬇️
react-components 48.00% <11.25%> (-3.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/dashboard/src/components/app-events.ts 100.00% <ø> (ø)
...dashboard/src/components/robots/robot-info-app.tsx 0.00% <ø> (ø)
.../dashboard/src/components/robots/robot-summary.tsx 0.00% <ø> (ø)
.../dashboard/src/components/tasks/task-inspector.tsx 0.00% <ø> (ø)
...kages/dashboard/src/components/tasks/task-logs.tsx 57.44% <ø> (ø)
packages/dashboard/src/components/workspace.tsx 0.00% <ø> (ø)
packages/react-components/lib/alert-dialog.tsx 76.92% <ø> (-3.08%) ⬇️
...t-components/lib/beacons/beacon-table-datagrid.tsx 90.90% <ø> (ø)
...react-components/lib/doors/door-table-datagrid.tsx 74.28% <ø> (ø)
packages/react-components/lib/lifts/lift-card.tsx 0.00% <ø> (ø)
... and 21 more

... and 9 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aaronchongth aaronchongth mentioned this pull request Sep 25, 2023
5 tasks
Angatupyry and others added 14 commits September 26, 2023 16:29
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
* Disable walls

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Use useLoader with url only, catch CORS errors potentially due to timeout issues when images are large

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Thanks for helping with this huge migration! I think we're in pretty good shape now. There might be small issues here and there that pops up, but we can fix them later on.

I'll move this to a reviewable so CI can be run on it. Once we address all the check failures and CI passes, I think we are good.

export const ReactThreeFiberImageMaker = ({ level, imageUrl }: ImageThreeProps): JSX.Element => {
let texture: Texture | undefined = undefined;
try {
texture = useLoader(TextureLoader, imageUrl);
Copy link
Member

Choose a reason for hiding this comment

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

This is a tricky check failure (sorry I introduced this), however I'm unsure how we can be sure the imageUrl is accessible in the first place, these were some of the things I found, https://www.freecodecamp.org/news/how-to-validate-urls-in-javascript/.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is currently working properly, could you try it?

@aaronchongth aaronchongth marked this pull request as ready for review October 5, 2023 17:37
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Just a comment left regarding linting, otherwise LGTM

Angatupyry and others added 3 commits October 10, 2023 16:03
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
* Set max heap size

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Stop producing sourcemap for CI

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* max space to ci

Signed-off-by: angatupyry <fierrofenix@gmail.com>

* Try build without sourcemap for CI, alongside heap size increment

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Increasing heapsize on bootstrap step

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Use experimental support for ECMAScript modules

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Use react-components as a module instead

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove use of meshes for robot icons

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert module call

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Co-authored-by: angatupyry <fierrofenix@gmail.com>
@aaronchongth aaronchongth changed the title [WIP] Migration to React three fiber Migration to React three fiber Oct 11, 2023
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good, just a few tweaks and naming suggestions left

packages/dashboard/src/components/map-app.tsx Outdated Show resolved Hide resolved
Signed-off-by: angatupyry <fierrofenix@gmail.com>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

I think we're in a good state! LGMT, thanks for this huge effort!

@aaronchongth aaronchongth merged commit 72b99d0 into main Oct 11, 2023
4 checks passed
@aaronchongth aaronchongth deleted the feature/port-three-fiber-branch branch October 11, 2023 17:28
@Angatupyry Angatupyry mentioned this pull request Oct 11, 2023
5 tasks
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