Git Product home page Git Product logo

Comments (18)

borislit avatar borislit commented on September 2, 2024 1

@zackkrida thanks for feedback. I was able to reproduce. Ill handle this ASAP and keep you posed

from vscode-glean.

MitchLillie avatar MitchLillie commented on September 2, 2024

I believe this should be tagged Stateless to Stateful. Also having this issue, seeing the error:

Property body of ClassMethod expected node to be of a type ["BlockStatement"] but instead got "JSXElement"

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@MitchLillie can you please provide an example of code you are trying to refactor?

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@zackkrida Fixed by c936135

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

I will release the version with the fix as soon as recent Github issues are resolved.

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@zackkrida Released https://github.com/wix/vscode-glean/releases/tag/v3.3.3 that includes the fix

from vscode-glean.

sekoyo avatar sekoyo commented on September 2, 2024

Hi I have 4.0.2 but have no option to convert the const style of function to a stateful class which is the only reason I installed it!

no-worky

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@dominictobias the issue the rest in props. The extension code that detects possible actions on selected code seems to have an issue with that. Will fix it ASAP.
For now, if you convert the props object to simple destructuring or remove it all together and just use "props" parameters - it should work.
image
image

from vscode-glean.

sekoyo avatar sekoyo commented on September 2, 2024

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@dominictobias I've added support for the rest operator in props :) Should be available in v4.0.3 :) Check it out!

from vscode-glean.

sekoyo avatar sekoyo commented on September 2, 2024

That was fast! No extra menu option is coming up for me though (in 4.0.3), here's the snippet I'm highlighting:

const Button = ({
  className,
  children,
  isActive,
  size,
  ...otherProps
}) => (
  <button
    className={classNames('Button', `Button--size${size}`, className, {
      'Button--isActive': isActive,
    })}
    type="button"
    {...otherProps}
  >
    {children}
  </button>
);

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@dominictobias works for me on the latest version:
image

from vscode-glean.

brownieboy avatar brownieboy commented on September 2, 2024

@dominictobias's sample Button code above doesn't work for me with Glean 4.15.2 on VSCode 1.35.1, running on Windows 10.

That "Convert Stateless..." popup menu option simply doesn't appear.

Edited: I originally said it was @borislit's sample code, not @dominictobias .

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@brownieboy please provide a code sample you are trying to refactor and ill have a look :)

from vscode-glean.

brownieboy avatar brownieboy commented on September 2, 2024

The Button code in this comment above #19 (comment)

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@brownieboy I was unable to reproduce the issue. See the attached GIF. Note that the option DOESNT show up if u select the imports too. Tell me if i can be of any help
Kapture 2019-08-21 at 22 51 36

from vscode-glean.

brownieboy avatar brownieboy commented on September 2, 2024

Thanks for investigating, @borislit .

Still not working for me. I've tried on two different machines: Windows 10 and Mac OS X Mojave. I still can't see all the menus. You can see that I am not highlighting the import statement:

glean-test

from vscode-glean.

borislit avatar borislit commented on September 2, 2024

@brownieboy Sorry for the delay. havent forgotten about this. Just been a bit busy. Ill have all at this ASAP

from vscode-glean.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.