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

fix: functions:serve should serve V2 Functions #6290

Merged
merged 25 commits into from
Jan 18, 2024

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Jan 9, 2024

functions:serve wasn't able to serve V2 Functions. This PR fixes that, and a couple of other things at the same time.

Resolves https://linear.app/netlify/issue/COM-139/ntl-functionsserve-doesnt-support-v2-functions.

@Skn0tt Skn0tt self-assigned this Jan 9, 2024
@Skn0tt
Copy link
Contributor Author

Skn0tt commented Jan 9, 2024

Starting with Draft to see if there's any failing tests.

const cleanPath = request.path.replace(/^\/.netlify\/(functions|builders)/, '')

functionName = cleanPath.split('/').find(Boolean)
const match = await functionsRegistry.getFunctionForURLPath(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main functional change, all the rest is cleanup.

Copy link

github-actions bot commented Jan 9, 2024

📊 Benchmark results

Comparing with 9a5a32f

  • Dependency count: 1,295 (no change)
  • Package size: 307 MB ⬇️ 0.00% decrease vs. 9a5a32f
  • Number of ts-expect-error directives: 1,171 ⬇️ 0.68% decrease vs. 9a5a32f

@Skn0tt Skn0tt marked this pull request as ready for review January 10, 2024 10:54
@Skn0tt Skn0tt requested a review from a team as a code owner January 10, 2024 10:54
const blobsContext = await getBlobsContext({
debug: options.debug,
projectRoot: command.workingDir,
siteID: site.id ?? 'unknown-site-id',
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be updated after #6299.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 17cfcaf

src/lib/functions/server.ts Outdated Show resolved Hide resolved
@Skn0tt Skn0tt requested a review from eduardoboucas January 18, 2024 14:29
@Skn0tt Skn0tt merged commit 301ccd0 into main Jan 18, 2024
37 checks passed
@Skn0tt Skn0tt deleted the functions-serve-v2-functions branch January 18, 2024 16:43
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.

2 participants