Skip to content

Maps refactor #1093

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Maps refactor #1093

wants to merge 7 commits into from

Conversation

Razzmatazzz
Copy link
Member

@Razzmatazzz Razzmatazzz commented Jun 5, 2025

Refactor the maps page to separate out different hooks that build the map. Previously, a single hook would create a new Leaflet map object and build the entire map. Now the following hooks all work together to build the map:

  • Initialize the Leaflet object (runs once per page load)
  • Load the map tiles and location markers (runs each time a new map is selected)
  • Load map markers based on map data from the API (runs when a new map is selected and then whenever the maps data refreshes)
  • Load map markers based on map and quest data from the API (runs when a new map is selected and then whenever the maps or quest data refreshes)
  • Load map markers based on map and items data from the API (runs when a new map is selected and then whenever the maps or items data refreshes)
  • Load the player position marker when the player position updates

I think this should make the page run more efficiently because the entire map is no longer being completely rebuilt anytime new data is available. Instead, just the markers associated with that data will be refreshed. I don't know if it will solve the memory leak issues, but it might help.

This should also resolve weirdness with the map where it would lose its pan and zoom when new data is loaded.

Finally, the player position marker is now restricted to a single height layer, and when the marker is updated it automatically activates the layer on which it appears.

@Razzmatazzz Razzmatazzz requested a review from a team as a code owner June 5, 2025 22:48
Copy link
Contributor

github-actions bot commented Jun 5, 2025

👋 Thanks for opening a pull request!

If you are new, please check out the trimmed down summary of our deployment process below:

  1. 👀 Observe the CI jobs and tests to ensure they are passing

  2. ✔️ Obtain an approval/review on this pull request

  3. 🚀 Deploy your pull request to the development environment with .deploy to development

  4. 🚀 Deploy your pull request to the production environment with .deploy

    If anything goes wrong, rollback with .deploy main

  5. 🎉 Merge!

Note: If you have a larger change and want to block deployments, you can run .lock --reason <reason> to lock all other deployments (remove with .unlock)

You can view the branch deploy usage guide for additional information

Shebuka
Shebuka previously approved these changes Jun 6, 2025
Copy link
Contributor

@Shebuka Shebuka left a comment

Choose a reason for hiding this comment

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

Massive improvement 👍

@Razzmatazzz Razzmatazzz dismissed Shebuka’s stale review June 6, 2025 10:48

The merge-base changed after approval.

@Razzmatazzz
Copy link
Member Author

.deploy

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Triggered 🚀

Razzmatazzz, started a branch deployment to production (branch: maps-refactor)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "timestamp": "2025-06-06T11:16:18.957Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15489276617"
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "8768e35aacea8307d0275ba0f2647ba39bf0df5e",
    "verified": false,
    "committer": "Razzmatazzz",
    "html_url": "https://github.com/the-hideout/tarkov-dev/commit/8768e35aacea8307d0275ba0f2647ba39bf0df5e"
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-06-06T11:16:02Z",
      "updated_at": "2025-06-06T11:16:02Z",
      "body": ".deploy",
      "html_url": "https://github.com/the-hideout/tarkov-dev/pull/1093#issuecomment-2948927021"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Results ✅

Razzmatazzz successfully deployed branch maps-refactor to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "id": 2593166846,
    "timestamp": "2025-06-06T11:18:14.503Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15489276617",
    "duration": 116
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "8768e35aacea8307d0275ba0f2647ba39bf0df5e",
    "verified": false
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 0,
    "decision": "REVIEW_REQUIRED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Environment URL: tarkov.dev

Shebuka
Shebuka previously approved these changes Jun 6, 2025
@Razzmatazzz
Copy link
Member Author

.deploy

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Triggered 🚀

Razzmatazzz, started a branch deployment to production (branch: maps-refactor)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "timestamp": "2025-06-06T14:58:09.804Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15493516831"
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "a05c744a700d2ae1468fd635424d41655bd63d53",
    "verified": false,
    "committer": "Razzmatazzz",
    "html_url": "https://github.com/the-hideout/tarkov-dev/commit/a05c744a700d2ae1468fd635424d41655bd63d53"
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-06-06T14:57:53Z",
      "updated_at": "2025-06-06T14:57:53Z",
      "body": ".deploy",
      "html_url": "https://github.com/the-hideout/tarkov-dev/pull/1093#issuecomment-2949528601"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Results ✅

Razzmatazzz successfully deployed branch maps-refactor to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "id": 2594013622,
    "timestamp": "2025-06-06T15:00:12.743Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15493516831",
    "duration": 123
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "a05c744a700d2ae1468fd635424d41655bd63d53",
    "verified": false
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 0,
    "decision": "REVIEW_REQUIRED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Environment URL: tarkov.dev

@Razzmatazzz
Copy link
Member Author

.deploy

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Triggered 🚀

Razzmatazzz, started a branch deployment to production (branch: maps-refactor)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "timestamp": "2025-06-06T15:04:07.182Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15493635358"
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "353329ae3479eeacbd032b18cdbc36a5876defa8",
    "verified": false,
    "committer": "Razzmatazzz",
    "html_url": "https://github.com/the-hideout/tarkov-dev/commit/353329ae3479eeacbd032b18cdbc36a5876defa8"
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-06-06T15:03:46Z",
      "updated_at": "2025-06-06T15:03:46Z",
      "body": ".deploy",
      "html_url": "https://github.com/the-hideout/tarkov-dev/pull/1093#issuecomment-2949546543"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Deployment Results ✅

Razzmatazzz successfully deployed branch maps-refactor to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": "https://tarkov.dev"
  },
  "deployment": {
    "id": 2594039355,
    "timestamp": "2025-06-06T15:06:08.781Z",
    "logs": "https://github.com/the-hideout/tarkov-dev/actions/runs/15493635358",
    "duration": 122
  },
  "git": {
    "branch": "maps-refactor",
    "commit": "353329ae3479eeacbd032b18cdbc36a5876defa8",
    "verified": false
  },
  "context": {
    "actor": "Razzmatazzz",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 0,
    "decision": "REVIEW_REQUIRED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

Environment URL: tarkov.dev

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