Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: setup in source config for functions #1143

Closed
wants to merge 11 commits into from

Conversation

jackiewmacharia
Copy link
Contributor

@jackiewmacharia jackiewmacharia commented Jul 11, 2022

πŸŽ‰ Thanks for submitting a pull request! πŸŽ‰

Summary

Related to:

Builds upon:

This PR provides in source configuration for functions. Test it out with the below function:

import { Handler } from '@netlify/functions'

const config = {
  nodeBundler: 'esbuild',
  includedFiles: ['blog/*.md']
}

const handler: Handler = async (event, context) => {
  const { name = 'stranger' } = event.queryStringParameters

  return {
    statusCode: 200,
    body: JSON.stringify({
      message: `Hello, ${name}!`,
    }),
  }
}

export {
  handler, config
}

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code πŸ§‘β€πŸ’».
    This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing
    a typo or something that`s on fire πŸ”₯ (e.g. incident related), you can skip this step.
  • Read the contribution guidelines πŸ“–. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) πŸ§ͺ
  • Update or add documentation (if features were changed or added) πŸ“
  • Make sure the status checks below are successful βœ…

A picture of a cute animal (not mandatory, but encouraged)
cute animal

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 11, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2022

⏱ Benchmark results

Comparing with 20fe86c

largeDepsEsbuild: 6.2s

⬆️ 5.35% increase vs. 20fe86c

^                   6.2s  
β”‚   5.9s    5.9s    β”Œβ”€β”€β”  
β”‚ β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€|β–’β–’|──
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴──>
    T-2     T-1      T    
Legend

largeDepsNft: 29.3s

⬆️ 0.52% increase vs. 20fe86c

^  29.2s   29.1s   29.3s  
β”‚   β”Œβ”€β”€β”    β”Œβ”€β”€β”    β”Œβ”€β”€β”  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴──>
    T-2     T-1      T    
Legend

largeDepsZisi: 44.6s

^  43.7s           44.6s  
β”‚   β”Œβ”€β”€β”            β”Œβ”€β”€β”  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |            |β–’β–’|  
β”‚   |  |    n/a     |β–’β–’|  
└───┴──┴────────────┴──┴──>
    T-2     T-1      T    
Legend

…m:netlify/zip-it-and-ship-it into feat/setup-in-source-config-for-functions
@jackiewmacharia jackiewmacharia marked this pull request as ready for review July 11, 2022 16:05
@jackiewmacharia jackiewmacharia requested a review from a team July 11, 2022 16:05
@jackiewmacharia
Copy link
Contributor Author

Converting back to draft since we will go with per file configuration for now.

@jackiewmacharia jackiewmacharia marked this pull request as draft July 19, 2022 08:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants