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

Remove implemented todos #38610

Merged
merged 2 commits into from Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/next/client/components/reducer.ts
Expand Up @@ -12,7 +12,6 @@ const fillCacheWithNewSubTreeData = (
existingCache: CacheNode,
flightDataPath: FlightDataPath
) => {
// TODO-APP: handle case of / (root of the tree) refetch
const isLastEntry = flightDataPath.length <= 4
const [parallelRouteKey, segment] = flightDataPath

Expand Down Expand Up @@ -267,7 +266,6 @@ const walkTreeWithFlightDataPath = (
const [currentSegment, parallelRouteKey] = flightSegmentPath

// Tree path returned from the server should always match up with the current tree in the browser
// TODO-APP: verify
if (!matchSegment(currentSegment, segment)) {
throw new Error('SEGMENT MISMATCH')
}
Expand Down Expand Up @@ -575,7 +573,6 @@ export function reducer(

cache.data = null

// TODO-APP: ensure flightDataPath does not have "" as first item
const flightDataPath = flightData[0]

if (flightDataPath.length !== 2) {
Expand Down
10 changes: 2 additions & 8 deletions packages/next/server/app-render.tsx
Expand Up @@ -456,7 +456,7 @@ export async function renderToHTML(
)
const isPreview = previewData !== false
const serverContexts: Array<[string, any]> = [
['WORKAROUND', null], // TODO-APP: First value has a bug currently where the value is not set on the second request
['WORKAROUND', null], // TODO-APP: First value has a bug currently where the value is not set on the second request: https://github.com/facebook/react/issues/24849
['HeadersContext', headers],
['CookiesContext', cookies],
['PreviewDataContext', previewData],
Expand All @@ -477,7 +477,6 @@ export async function renderToHTML(
treeValue: string
type: DynamicParamTypesShort
} | null => {
// TODO-APP: use correct matching for dynamic routes to get segment param
const segmentParam = getSegmentParam(segment)
if (!segmentParam) {
return null
Expand Down Expand Up @@ -643,7 +642,6 @@ export async function renderToHTML(
let fetcher: (() => Promise<any>) | null = null

type GetServerSidePropsContext = {
// TODO-APP: has to be serializable
headers: IncomingHttpHeaders
cookies: NextApiRequestCookies
layoutSegments: FlightSegmentPath
Expand All @@ -669,7 +667,7 @@ export async function renderToHTML(
headers,
cookies,
layoutSegments: segmentPath,
// TODO-APP: Currently query holds params and pathname is not the actual pathname, it holds the dynamic parameter
// TODO-APP: change pathname to actual pathname, it holds the dynamic parameter currently
...(isPage ? { query, pathname } : {}),
...(pageIsDynamic ? { params: currentParams } : undefined),
...(isPreview
Expand All @@ -685,7 +683,6 @@ export async function renderToHTML(
if (layoutOrPageMod.getStaticProps) {
const getStaticPropsContext = {
layoutSegments: segmentPath,
// TODO-APP: change this to be URLSearchParams instead?
...(isPage ? { pathname } : {}),
...(pageIsDynamic ? { params: currentParams } : undefined),
...(isPreview
Expand Down Expand Up @@ -832,9 +829,6 @@ export async function renderToHTML(
// TODO-APP: validate req.url as it gets passed to render.
const initialCanonicalUrl = req.url!

// TODO-APP: change tree to accommodate this
// /blog/[...slug]/page.js -> /blog/hello-world/b/c/d -> ['children', 'blog', 'children', ['slug', 'hello-world/b/c/d']]
// /blog/[slug] /blog/hello-world -> ['children', 'blog', 'children', ['slug', 'hello-world']]
const initialTree = createFlightRouterStateFromLoaderTree(tree)

const initialStylesheets: string[] = getCSSInlinedLinkTags(
Expand Down