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: Option to create Edge Functions with JavaScript syntax #2763

Closed
wants to merge 3 commits into from

Conversation

laktek
Copy link
Contributor

@laktek laktek commented Oct 14, 2024

What kind of change does this PR introduce?

This PR adds the option to create, serve, and deploy pure JS functions instead of using TypeScript.

Users can set EdgeRuntime.default_language to either JavaScript or TypeScript to set the language template they want to use. This can be overridden with lang flag when using functions new.

functions serve and functions deploy will now treat for both index.js and index.ts as valid entrypoints.

@coveralls
Copy link

coveralls commented Oct 14, 2024

Pull Request Test Coverage Report for Build 11319321701

Details

  • 42 of 59 (71.19%) changed or added relevant lines in 5 files are covered.
  • 16 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.09%) to 60.153%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/functions.go 1 2 50.0%
internal/functions/deploy/deploy.go 7 11 63.64%
internal/functions/new/new.go 29 41 70.73%
Files with Coverage Reduction New Missed Lines %
internal/functions/new/new.go 2 78.13%
internal/gen/keys/keys.go 5 12.9%
internal/utils/config.go 9 86.0%
Totals Coverage Status
Change from base Build 11290838108: -0.09%
Covered Lines: 6538
Relevant Lines: 10869

💛 - Coveralls

return err
}
// update config
if err := utils.InitConfig(utils.InitParams{EdgeRuntimeDefaultLanguage: choice.Summary, Overwrite: true}, fsys); err != nil {
Copy link
Contributor

@sweatybridge sweatybridge Oct 14, 2024

Choose a reason for hiding this comment

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

reminder to self: support in-place config update to unblock this functions use case

@laktek
Copy link
Contributor Author

laktek commented Oct 30, 2024

Will revisit this after we have support to update config.toml

@laktek laktek closed this Oct 30, 2024
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