Live data from Hacker News

Show HN: Copy React code from any site

sample-code.aspect.app

51–60 of 83 posts

Re: Show HN: Copy React code from any site

#51
post #46

This is pretty cool. Are you worried about copyright at all though? Especially if this get used in a commercial context?

if the code for the web app is available (assuming a license that permits it) there is no need to use an extension to copy a component. you got the source code if the code is not available, very likely you will not have permission to use it. Don't see a legal usage of this kind of tool in a commercial context. Pretty useful as a learning too though

I feel like "availability to copy" or "inspectable" is not a reason to abandon Copyright protection.

After all, it is currently the nature of web software that the source code must be available (for browsers to interpret)

Re: Show HN: Copy React code from any site

#53
post #46

This is pretty cool. Are you worried about copyright at all though? Especially if this get used in a commercial context?

if the code for the web app is available (assuming a license that permits it) there is no need to use an extension to copy a component. you got the source code if the code is not available, very likely you will not have permission to use it. Don't see a legal usage of this kind of tool in a commercial context. Pretty useful as a learning too though

I don't think that's entirely valid, you can point a camera to a playing movie but that doesn't waive any copyright.

Re: Show HN: Copy React code from any site

#54
Took a look, seems to me like the title is a bit misleading. Maybe I'm mistaken but from watching the video I don't get the sense that this copies 'React code', from any site, it just takes a section of the dom from any site and copies over the relevant css and js. I think something like this is going to take off though, as frontend devs we keep reinventing the wheel needlessly. You should be able to point to a site, any site, and basically clone it. Generate a suitable backend while you're at it. Do a style transfer. So say I want to have an ecommerce shop in a certain niche, point to an existing online store, do a style transfer, and boom you have the same functionality just with original content and style.

Addendum: Figured I should give it a try because I think the idea has promise. But I tried this on three sites, a regular js site, a next.js site and a CRA site. Each time tried to do a 'Copy React' op on a button, and each time I just got back html.

Re: Show HN: Copy React code from any site

#55
I think this is very cool, but two thoughts:

1) Your explainer "Copy React code from any website" implies that I'm copying the react code from a website. What you are doing is copying the html/css of a website and then exporting it to an autogenerated react component(s).

2) It would be great if the demo video showed the React component generated. Is all of the html thrown into 1 component? Is the resulting html clean? Or is it cluttered with html attributes that aren't actually needed?

Re: Show HN: Copy React code from any site

#56
post #29

Nice work and an excellent landing page; congrats! What happens if the target website uses a react component library (like mui)? I guess for some use cases it could still be useful to extract just a portion of that code. But in other scenarios it might be cleaner to just use that component library.

Thanks! It'll work so long as what's rendered is html, instead of say a canvas element.

Re: Show HN: Copy React code from any site

#59
post #11

How is that not considered creating derivative works? Would not touch this for anything beyond basic toys and never for anything commercial, no chance in hell. Edit: view source exists of course, and I think we’ve all copy pasted something from a source view out of convenience but something about copying entire components with styles and everything just feels wrong , and possibly legally grey depending on who you mig…

Your response tells me it is a game changer and is going to be useful for tons of developers. I predict that they will create this for Angular, Vue, Svelte, etc.

Perhaps you could elaborate because I’m not seeing how it’s a “game changer”.

Re: Show HN: Copy React code from any site

#60
Most of the complexity of React components is in the business logic (validation, interactivity, accessibility, data fetching, etc.). It seems like this isn't going to help you with that and indeed will make it harder since it's probably generating some cluttered HTML. Or what if you want a consistent set of styles for multiple components? You probably have to recreate everything from scratch at that point.

It seems fine for simple mocks/POC type stuff.

Post reply on HN