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

feature: Enabled Remaining Routes in Novo #6784

Merged
merged 1 commit into from
Dec 14, 2020

Conversation

icirellik
Copy link
Contributor

This change adds the remaining routes to Novo and in doing so adds their
contents to novo assets. This is needed so that we can begin to analyze
the contents and potentially reduce its size before swapping over
a live page.

@@ -18,7 +18,7 @@ const ArtistsByLetterRoute = loadable(
}
)

export const artistsRoutes: RouteConfig[] = [
export const routes: RouteConfig[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we renaming these, if we need to import as artistsRoutes anyways?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It felt like a reasonable time to make the names consistent. There are potential benefits of having a consistent interface if we wanted to make the route loader smarter in the future.

I will revert them if you'd like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

routes seemed to be the preference.

Copy link
Member

@damassi damassi Dec 10, 2020

Choose a reason for hiding this comment

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

Not having them named artistsRoutes, artworkRoutes, etc, is actually tech debt that we've been needing to fix for some time because its causing us problems differentiating between different relay queries (due to the need for relay output fragments to include the file name). We've just never gotten around to fixing this. For example, this came up yesterday:

https://artsy.slack.com/archives/CP9P4KR35/p1607534922411300

[RelayCache#set] Success {"queryId":"routes_ShowInfoQuery","variables":{"slug": slug}}

If we had this route file named showRoutes then there would have been no confusion here in our server logs during the incident.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those query names are independent of the named export. As far as the export if concerned routes is good and appropriate from a systems architecture perspective, plus a stack trace will provide the correct data.

💯 agree that those queries should be updated, we have similar issues with anonymous functions throughout force. Taking a look at the exports for the files I modified they suffer from the same inconsistency so let's not block changes for unrelated reasons:

https://github.com/artsy/force/blob/master/src/v2/Apps/Conversation/routes.tsx#L16

Copy link
Member

@damassi damassi Dec 11, 2020

Choose a reason for hiding this comment

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

The thing is is that relay, from a compiler level, requires that the file name be prefixed in the query; we can't update the query name without updating the filename.

Example error:

ERROR:
Parse error: Error: RelayFindGraphQLTags: Operation names in graphql tags must be prefixed with the module name and end in "Mutation", "Query", or "Subscription". Got `conversationRoutes_ConversationQuery` in module `routes`. in "Apps/Conversation/routes.tsx"

(This change can happen in a different PR tho, just a bit of FYI background)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like everything is good as is then, I don't plan on renaming the files.

This change adds the remaining routes to Novo and in doing so adds their
contents to novo assets. This is needed so that we can begin to analyze
what the contents and potentially reduce its size before swapping over
a live page.
@eessex eessex merged commit b98117e into master Dec 14, 2020
@eessex eessex deleted the feature-enable-routes-in-novo branch December 14, 2020 16:08
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.

3 participants