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

Refactor all special case shield definitions inline #1081

Merged
merged 8 commits into from
Jun 5, 2024

Conversation

claysmalley
Copy link
Member

Corollary to #1074. This PR removes the special case section at the bottom of shield_defs.js, and collates all the instances of overrideByRef, overrideByName and refsByName inline with their geographically sorted definitions.

@ZeLonewolf
Copy link
Member

Do we know why the ShieldJSON got smaller in the stats? Just want to make sure we're not losing anything in the refactor.

@claysmalley
Copy link
Member Author

I changed US:NH:Turnpike to use the color constants instead of hardcoded hex values, and US:TX:Harris:HCTRA to be variable-width. Would either of those changes mess with the ShieldJSON size?

@ZeLonewolf
Copy link
Member

I actually misspoke, the stats say the ShieldJSON is 1,484 bytes larger. That sounds like there's somehow an extra shield entry in this. I went shield by shield and couldn't find it though.

@ZeLonewolf
Copy link
Member

I ran a script to compare the two shield json files between this PR and main, and the attached report shows the differences (in theory).
compare_report.txt

src/js/shield_defs.js Outdated Show resolved Hide resolved
src/js/shield_defs.js Outdated Show resolved Hide resolved
Copy link
Member

@ZeLonewolf ZeLonewolf left a comment

Choose a reason for hiding this comment

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

On review of the comparison report, the extra size is due to bannered Georgia routes. After this consolidation, the bannered Georgia routes also gained the overrideByRef definitions for routes 515 and 520 (the blue and green routes). The prior code had the overrides get set later in the file and only on the main Georgia route networks, not the variants. Once #1073 is complete, this bit of extra duplication will go away. As such, I think this is OK to proceed with!

@claysmalley claysmalley merged commit a7ec604 into main Jun 5, 2024
6 checks passed
@claysmalley claysmalley deleted the clay-shields-refactor-special-cases branch June 5, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants