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

Do not include Facebook license on users codegen'd code #31516

Closed
wants to merge 2 commits into from

Conversation

acoates-ms
Copy link
Contributor

Summary

The codegen generates a Facebook copyright notice at the top of the generated files. While this might make sense on the core files, this codegen will be run on external components too. The notice also refers to a LICENSE file in the root of this project, which might not be there if this is run on another project. I did a quick look at some of the codegen that we ship within windows dev tools, and it looks like we normally just have comments saying the file was codegen'd and so the file shouldn't be manually edited.

Open to suggestions on what the comment header should say.

Changelog

[General] [Changed] - Do not include Facebook license on users codegen'd code

Test Plan

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Microsoft Partner: Microsoft Partner labels May 12, 2021
@acoates-ms acoates-ms added the Tech: Codegen Related to react-native-codegen label May 12, 2021
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 9,249,693 +0
android hermes armeabi-v7a 8,768,468 +0
android hermes x86 9,712,509 +0
android hermes x86_64 9,678,506 +0
android jsc arm64-v8a 10,868,243 +0
android jsc armeabi-v7a 10,380,053 +0
android jsc x86 10,897,791 +0
android jsc x86_64 11,505,700 +0

Base commit: b2dbde3

@hramos
Copy link
Contributor

hramos commented May 13, 2021

Thanks for the PR. Let me run this through our OSS IP team and I'll get back to you.

@hramos hramos self-assigned this May 13, 2021
@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 7, 2021
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Hey @acoates-ms,
Thanks for the PR. I'd like to review it and drive it to landing if you wish.

Can I ask you to:

  • Rebase on top of main
  • Apply the changes I suggested to all the templates?

@@ -17,10 +17,10 @@ type FilesOutput = Map<string, string>;

const template = `
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* This code was generated by a tool.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* This code was generated by a tool.
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).

Comment on lines +22 to +23
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.

@cortinico cortinico assigned cortinico and unassigned hramos Jan 6, 2022
cortinico added a commit to cortinico/react-native that referenced this pull request Jan 6, 2022
Summary:
Closes facebook#31516
I've cherry-picked the original PR that had merge conficts + updated all
the headers as the one for the TurboModule generators were not handled.

Original Commit Message from acoates

The codegen generates a Facebook copyright notice at the top of the generated files.

While this might make sense on the core files, this codegen will be run on external components too.
The notice also refers to a LICENSE file in the root of this project, which might not be there if this is run on another project.
I did a quick look at some of the codegen that we ship within windows dev tools, and it looks like we normally just have comments
saying the file was codegen'd and so the file shouldn't be manually edited.
Open to suggestions on what the comment header should say.

Changelog:
[General] [Changed] - Do not include Facebook license on users codegen'd code

Differential Revision: D33455176

fbshipit-source-id: d64e1a75d23d80a7acae1e15ea7d751d7a316129
@cortinico
Copy link
Contributor

@acoates-ms I've published this #32840 that is going to close this PR as it has several merge conflicts + The files inside src/generators/modules were missing. So this updates the header for all the generated files 👍

cortinico added a commit to cortinico/react-native that referenced this pull request Jan 7, 2022
Summary:
Pull Request resolved: facebook#32840

Closes facebook#31516
I've cherry-picked the original PR that had merge conficts + updated all
the headers as the one for the TurboModule generators were not handled.

Original Commit Message from acoates

The codegen generates a Facebook copyright notice at the top of the generated files.

While this might make sense on the core files, this codegen will be run on external components too.
The notice also refers to a LICENSE file in the root of this project, which might not be there if this is run on another project.
I did a quick look at some of the codegen that we ship within windows dev tools, and it looks like we normally just have comments
saying the file was codegen'd and so the file shouldn't be manually edited.
Open to suggestions on what the comment header should say.

Changelog:
[General] [Changed] - Do not include Facebook license on users codegen'd code

Differential Revision: D33455176

fbshipit-source-id: 5bcc73155d79ee7128726ec040bb6a5f94623baf
@acoates-ms acoates-ms deleted the codegenlicense branch September 2, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Needs: React Native Team Attention p: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Tech: Codegen Related to react-native-codegen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants