Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Central georouting support #2531
Central georouting support #2531
Changes from 4 commits
7e281ea
642e82e
45aa8c0
fa6c3d3
af705d1
1da0a82
44c6549
cd751c7
e2676b8
bc7410f
bd96b1c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
would be great to use optional chaining to make sure it doesn't throw an error here
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.
I think we're mixing scope here and this will eventually be hard to remove when we fully deprecate the old geo-routing feature.
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.
To provide backward compatibility, we still need to ensure that fetch(${config.contentRoot ?? ''}/georoutingv2.json) doesn't exist before we go ahead and load the federal georoutingv2 file.
I am not seeing any other way to handle this case without introducing additional configuration from consumer. However, I am open to suggestions.
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.
We could always configure a project and say pick up the georouting from federal via metadata.
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.
I don't have the full context of why the old georouting is required, but here a suggestion that would provide a bit more clarity on the load order, avoiding a nested if/else structure:
The way I understand it, we want to load georoutingv2, if that's not available the legacy georouting and then the federal georouting as backup?
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.
Yes, correct. I agree it looks cleaner and more readable. I will update it.
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 allowed origins are strictly related to federal content, so we either rename the constant or we move it within the method.
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 remove blog from this list. Blog does not use GeoRouting.
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.
IMO we should have a dynamic import for the whole federated content or move it to its own separate module.
I would guess that most pages do not use federal content and thus shouldn't load it at all.
The blocks that do use the feature, should load it themselves.