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

Simplify React name trimming function. #44

Closed
wants to merge 5 commits into from
Closed

Simplify React name trimming function. #44

wants to merge 5 commits into from

Conversation

wesc
Copy link
Collaborator

@wesc wesc commented Jul 25, 2024

This simplifies the way in which we create a trimmed react name, which has downstream implications in a few places. For example, this function is used in generating the Native___ names, spec names, and namespace. Previously, if you named your package RNFoo vs Foo then you would get FooSpec in both cases, as well as placement in the foo namespace. This is specialized knowledge a user of the ubrn would need to know. Whereas now, RNFoo results in RnFooSpec and rnfoo, and Foo results in FooSpec and foo.

It's possible I've misunderstood what the point of this was.. just I was having difficulty understanding in what cases I could drop RN, and in what cases Native got prefixed. I'm open to doing something different here, I just want to minimize the surprise from the user's perspective.

@wesc wesc requested a review from jhugman July 25, 2024 17:44
@zzorba zzorba force-pushed the trim-name branch 3 times, most recently from 73f5ef4 to 536c59a Compare August 19, 2024 20:56
@zzorba zzorba force-pushed the trim-name branch 2 times, most recently from 812f39d to 3a6521d Compare September 10, 2024 16:58
@jhugman jhugman closed this in #98 Sep 27, 2024
jhugman added a commit that referenced this pull request Sep 27, 2024
According to [The Big O of Code
Reviews](https://www.egorand.dev/the-big-o-of-code-reviews/), this is a
O(_n_) change.

Fixes #44.

This PR investigates and fixes how the React Native Codegen file is
named, taking into consideration the rules around what it creates.

It turns out that it:

 * has to start with `Native`
 * it is the file name that is used to generate all the other files 
 * the spec name in pacakge.json seems to be irrelevant.

The PR still allows ReactNative and RN to be trimmed, but only if it is
not specified in the configuration YAML.

E.g. `name: RnDiode` to the top of the `config.yaml`.
@zzorba zzorba reopened this Sep 30, 2024
@jhugman jhugman closed this in #100 Sep 30, 2024
@jhugman jhugman closed this in 20a8699 Sep 30, 2024
@jhugman jhugman deleted the trim-name branch November 3, 2024 19:24
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

Successfully merging this pull request may close these issues.

2 participants