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

[React Wrappers] react and jsdoc mixup private function #62

Closed
pascalvos opened this issue Jan 16, 2024 · 4 comments
Closed

[React Wrappers] react and jsdoc mixup private function #62

pascalvos opened this issue Jan 16, 2024 · 4 comments

Comments

@pascalvos
Copy link

Hey Burton i have found an other small bug

if i have a method like this

#myPrivateMethod() {

}

this will work it will be private and have no problems it makes this place

  useImperativeHandle(forwardedRef, () => ({}));
/*
* This is my private method
*/
#myPrivateMethod() {

}

this somehow ends up in the wrapper

  /** Methods - uses `useImperativeHandle` hook to pass ref to component */
  useImperativeHandle(forwardedRef, () => ({
    #myPrivateMethod: () => ref.current.#myPrivateMethod(),
  }));

I can fix this by doing

/*
* @private
* this is my private method
*/
#myPrivateMethod() {

}

but it would be nice to skip these private methods that have comments from the wrapper by default

@pascalvos
Copy link
Author

might be because

   {
              "kind": "method",
              "name": "#myPrivateMethod"
  },

it doesn't get marked as private in the custom-element.json

@break-stuff
Copy link
Owner

Oh, interesting. It looks like the Analyzer doesn't mark those as private. I should be able to add a patch for that in my repo until they fix it on their end. Thank you for bringing it to my attention!

@break-stuff break-stuff changed the title react and jsdoc mixup private function [React Wrappers] react and jsdoc mixup private function Jan 21, 2024
@break-stuff
Copy link
Owner

A fix for this has been deployed in release 1.2.0 (#67). Let me know if you run into any issues.

@break-stuff
Copy link
Owner

As a point of reference, a bug has been filed with the CEM Analyzer to mark these methods as private.

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

No branches or pull requests

2 participants