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

feat(start): move scripts,links, and meta to the head #2571

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

SeanCassiere
Copy link
Member

@SeanCassiere SeanCassiere commented Oct 18, 2024

Closes #2426

As discussed in #2426, this change adds a new method named head onto Route. This function takes in the same parameters as meta and returns the values used for scripts, links, and meta. Additionally, the loaderData argument is made to be possibly undefined as this execution may happen both before and after the loader has resolved.

The meta, links, and scripts methods on Route as being dropped and replaced by this new head method.

this change only changes the interface presented to the dev (AnyRoute). the actual interface for a match (AnyRouteMatch) remains the same
Copy link

nx-cloud bot commented Oct 18, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 03f8e9d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build --parallel=3
✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

pkg-pr-new bot commented Oct 18, 2024

Open in Stackblitz

More templates

@tanstack/create-router

pnpm add https://pkg.pr.new/@tanstack/create-router@2571

@tanstack/eslint-plugin-router

pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-router@2571

@tanstack/react-cross-context

pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2571

@tanstack/react-router

pnpm add https://pkg.pr.new/@tanstack/react-router@2571

@tanstack/history

pnpm add https://pkg.pr.new/@tanstack/history@2571

@tanstack/react-router-with-query

pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2571

@tanstack/router-arktype-adapter

pnpm add https://pkg.pr.new/@tanstack/router-arktype-adapter@2571

@tanstack/router-cli

pnpm add https://pkg.pr.new/@tanstack/router-cli@2571

@tanstack/router-devtools

pnpm add https://pkg.pr.new/@tanstack/router-devtools@2571

@tanstack/router-generator

pnpm add https://pkg.pr.new/@tanstack/router-generator@2571

@tanstack/router-plugin

pnpm add https://pkg.pr.new/@tanstack/router-plugin@2571

@tanstack/router-valibot-adapter

pnpm add https://pkg.pr.new/@tanstack/router-valibot-adapter@2571

@tanstack/router-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2571

@tanstack/router-zod-adapter

pnpm add https://pkg.pr.new/@tanstack/router-zod-adapter@2571

@tanstack/start

pnpm add https://pkg.pr.new/@tanstack/start@2571

@tanstack/start-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2571

@tanstack/virtual-file-routes

pnpm add https://pkg.pr.new/@tanstack/virtual-file-routes@2571

commit: 03f8e9d

@@ -111,20 +111,17 @@ export function afterHydrate({ router }: { router: AnyRouter }) {
}
}

const meta =
match.status === 'success'
Copy link
Contributor

Choose a reason for hiding this comment

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

is the status not relevant anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

No anymore, since that was only dependent for the loaderData.
Now the loaderData is always possibly undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants