Skip to content

Update custom-functions guide - #1000

Merged
sequba merged 16 commits into
developfrom
feature/issue-968
Jun 10, 2022
Merged

sequba merged 16 commits into
developfrom
feature/issue-968

Conversation

@sequba

@sequba sequba commented Jun 1, 2022 •

Copy link
Copy Markdown
Contributor

Context

Changes to the custom-functions guide:

  • start the guide with a step-by step tutorial about implementing the simplest possible function
  • make it clear that defining translations is a required step
  • encourage using runFunction helper method
  • convert the code examples from Typescript to Javascript
  • fix minor bugs in code examples

Other changes:

  • fixa bug in production code: implementedFunctions.parameters should be optional
  • add a few unit tests not related to custom functions. I wrote these tests while investigating other issues.

TODO:

  • update hyperformula-demos

How has this been tested?

  • verify code examples in CodeSandbox
  • run documentation locally and make sure it renders correctly

Types of changes

  • Docs

Related issue(s):

  1. Fixes Custom functions guide is outdated #968
  2. Can't get the custom functions to work #965

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

@sequba sequba self-assigned this Jun 1, 2022
@sequba
sequba changed the base branch from master to develop June 1, 2022 08:27
@sequba
sequba marked this pull request as draft June 1, 2022 08:27
fn: (...arg: any) => InterpreterValue,
) => {
let argumentDefinitions: FunctionArgument[] = metadata.parameters!
let argumentDefinitions: FunctionArgument[] = metadata.parameters || []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a bugfix. Our documentation says that parameters field is optional, but this function fails when it's not defined.

@sequba
sequba marked this pull request as ready for review June 4, 2022 15:20
@sequba
sequba requested a review from warpech June 4, 2022 15:20
@sequba
sequba requested a review from kirszenbaum June 7, 2022 10:32

@kirszenbaum kirszenbaum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sequba – I added my suggestions in #1010

Jakub Wiśniewski and others added 2 commits June 10, 2022 12:46
* Review the custom functions guide rewrite

Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com>
@sequba

sequba commented Jun 10, 2022

Copy link
Copy Markdown
Contributor Author

@kirszenbaum suggestions applied.

@sequba
sequba requested a review from kirszenbaum June 10, 2022 11:00
Comment thread docs/guide/custom-functions.md Resolved
Comment thread docs/guide/custom-functions.md Resolved
Comment thread docs/guide/custom-functions.md Resolved
Comment thread docs/guide/custom-functions.md Resolved
Comment thread docs/guide/custom-functions.md Resolved
Co-authored-by: Jakub Wiśniewski <jakub.wisniewski@handsontable.com>
@sequba
sequba requested a review from kirszenbaum June 10, 2022 11:56
@codecov

codecov Bot commented Jun 10, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1000 (9051106) into develop (e43b397) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1000   +/-   ##
========================================
  Coverage    95.73%   95.73%           
========================================
  Files          161      161           
  Lines        14056    14056           
  Branches      2965     2966    +1     
========================================
  Hits         13456    13456           
  Misses         584      584           
  Partials        16       16           
Impacted Files Coverage Δ
src/interpreter/plugin/FunctionPlugin.ts 98.90% <100.00%> (ø)

@sequba
sequba merged commit 34127eb into develop Jun 10, 2022
@sequba
sequba deleted the feature/issue-968 branch June 10, 2022 12:16
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.

Custom functions guide is outdated

2 participants