Live data from Hacker News

Show HN: Copy React code from any site

sample-code.aspect.app

61–70 of 83 posts

Re: Show HN: Copy React code from any site

#61

Remember: others' work is theirs unless they license it to you. Just because you technically can copy something doesn't mean you're allowed to make and distribute copies or derivatives. If you do this professionally, you'll get yourself or your employer sued, and/or your work pulled off the internet against your will. You wouldn't steal a policeman's helmet, etc.

we're a bit past this point by now. Most people npm install some package, use webpack/minify to bundle it up, and poof no copyright or attribution. Even though both MIT and BSD (the most common licenses) require this. Even if you do the magical incantation to retain comments in your bundle, many packages don't include copyright in the comments. They include it in a LICENSE or README file.

Once upon a time devs cared about this sort of thing. Living through the '90s and then now... where devs just pick the default license (MIT?) that github puts on a repo is crazy. There is this cultural assumption today that everything is just a public domain free-for-all.

Re: Show HN: Copy React code from any site

#62
post #22

Remember: others' work is theirs unless they license it to you. Just because you technically can copy something doesn't mean you're allowed to make and distribute copies or derivatives. If you do this professionally, you'll get yourself or your employer sued, and/or your work pulled off the internet against your will. You wouldn't steal a policeman's helmet, etc.

> Remember: others' work is theirs unless they license it to you. But Google scraping the web is somehow allowed? I'm not against it but these laws seem arbitrary.

Google respects robots.txt. Allowing Google scraping is optional. In fact many websites serve more content to google bot than to you before you log in, google bots clip through paywalls

Re: Show HN: Copy React code from any site

#63

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…

At the time of posting, the extension actually allows you to export either jsx (which you can directly place in a react file) or html. That detail just isn't shown in the video, which shows an earlier version of the feature. Will update video.

Re: Show HN: Copy React code from any site

#64

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,…

The react export option exports inline jsx for now. You should be able to directly paste that into a react file, as opposed to the html export. I purposely don't wrap the jsx in a named component since I can see all kinds of use cases where a person wants to inject jsx into a part of an existing component.

Re: Show HN: Copy React code from any site

#65
post #64

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,…

The react export option exports inline jsx for now. You should be able to directly paste that into a react file, as opposed to the html export. I purposely don't wrap the jsx in a named component since I can see all kinds of use cases where a person wants to inject jsx into a part of an existing component.

You are right, it is not plain html, it is jsx.

Re: Show HN: Copy React code from any site

#67

Earlier quoted context omitted.

All laws are arbitrary. But the story of how we got them is meaningful. Copyright exists to encourage more copyable stuff to be made (pg has a good essay on this topic, where he observes history shows the opposite of a copyright regime isn't openness... It's guilds and secrecy cults). What Google does (interpreting the data that scans to help you find references to searches) is considered either transformative work,…

> Copyright exists to encourage more copyable stuff to be made This is a backward legitimization attempt. Copyright was made because editors, authors and composers lobbied to get a monopoly on their creations and derivative work. As a matter of fact, copyright was continuously expanded on requests from rent-seeking copyright holders (which, in the overwhelming majority of case, aren't creators of any kind).

> This is a backward legitimization attempt.

Not if you believe Jefferson's thoughts on the topic.

"It has been pretended by some, (and in England especially,) that inventors have a natural and exclusive right to their inventions, and not merely for their own lives, but inheritable to their heirs. But while it is a moot question whether the origin of any kind of property is derived from nature at all, it would be singular to admit a natural and even an hereditary right to inventors. It is agreed by those who have seriously considered the subject, that no individual has, of natural right, a separate property in an acre of land, for instance. By an universal law, indeed, whatever, whether fixed or movable, belongs to all men equally and in common, is the property for the moment of him who occupies it, but when he relinquishes the occupation, the property goes with it. Stable ownership is the gift of social law, and is given late in the progress of society... Society may give an exclusive right to the profits arising from [ideas], as an encouragement to men to pursue ideas which may produce utility, but this may or may not be done, according to the will and convenience of the society, without claim or complaint from anybody. Accordingly, it is a fact, as far as I am informed, that England was, until we copied her, the only country on earth which ever, by a general law, gave a legal right to the exclusive use of an idea. In some other countries it is sometimes done, in a great case, and by a special and personal act, but, generally speaking, other nations have thought that these monopolies produce more embarrassment than advantage to society; and it may be observed that the nations which refuse monopolies of invention, are as fruitful as England in new and useful devices." ~Thomas Jefferson, letter to Isaac McPherson, 13 Aug. 1813

The goal was to encourage innovation. I don't disagree at all that the goal was regulatory-captured in a significant way by rentiers, but its purpose is, counterintuitively, to incentivize pushing ideas out into the light.

Re: Show HN: Copy React code from any site

#68

Reminds me of CSS scan [1]. It was also on Hacker News [2] a while back. [1] https://cssscan.pro/ [2] https://news.ycombinator.com/item?id=17609252

Wow, $20/month or $120 yearly for what looks like a very thin wrapper on inspect-element features. I'm sure some might be willing to pay for the convenience it adds, yet with a free near-equivalent baked into every browser that's a tough sell.

Re: Show HN: Copy React code from any site

#69
post #42

Remember: others' work is theirs unless they license it to you. Just because you technically can copy something doesn't mean you're allowed to make and distribute copies or derivatives. If you do this professionally, you'll get yourself or your employer sued, and/or your work pulled off the internet against your will. You wouldn't steal a policeman's helmet, etc.

Two absurd claims: 1. Getting sued 2. Getting your work pulled off the internet You say that you or your employer would be sued if you did this. Going through a legal battle over some copied HTML, CSS & JavaScript is expensive, distracting and time consuming. You'd first get a cease and desist letter. Who has the time or energy to sue over this? Getting your work pulled off the internet against your will. How would t…

C&D is a low effort shot to stop infringement. Suits follow where wilful and especially profitable or profit-damaging activity that can be shown. Eg, you stick it in your product. Saying suits are fanciful is harmful because they do happen. They often settle early, but that's attention your employer won't thank you for. It'll be grounds in many cases.

Very familiar with TPB. Their founders did time for their involvement. I've also sent DMCA notices and had content pulled from services, even a domain pulled by its host because the owner ignored the notice. You absolutely can take extraordinary steps to work around it but you know... Maybe just write your own components?

I've no opinion on this tool. It's a tool, like a text editor or View Source. I'm posting because of what people are suggesting doing with it.

Re: Show HN: Copy React code from any site

#70
post #63

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…

At the time of posting, the extension actually allows you to export either jsx (which you can directly place in a react file) or html. That detail just isn't shown in the video, which shows an earlier version of the feature. Will update video.

Some logic to rename variables and perhaps wrap on-screen text with an instruction to rephrase, coupled with watermarking images so they have to be replaced, might effectively render copyright objections void/unenforceable ... it's not like you can copyright the general techniques. This would make it a far more viable commercial tool.

If this could be combined with tooling to facilitate the use of generated code to more easily produce React Native compliant versions, giving you a quicker path to iOS and Android equivalents, you would be halfway to auto-generating what 90% of non-technical people want when they say "just build me something like X site/app".

Post reply on HN