Skip to content

Commit

Permalink
Update 'master' branch references to 'main' branch
Browse files Browse the repository at this point in the history
Summary:
G'day folks! As promised, I'm spending a bit of my free time seeing what I can do to update and refresh the IGListKit repo on GitHub.

I noticed last night some strange behaviour in that the GitHub Actions CI wasn't running when new commits were merged into the main branch. I discovered the cause of this was because the `CI.yml` file still had `master` in its build rules instead of `main`. And once I noticed that, I noticed there were a lot of other references to the main branch being called `master` in a lot of the documentation.

Thankfully within the documentation, GitHub was smart enough to automatically redirect all of the `master` URLs to `main`, so nothing visibly broke, but I definitely think we should update all of that. :)

I went through the entire repo and did a thorough audit in all of its text files, and updated the main branch name accordingly.

Reviewed By: DimaVartanian

Differential Revision: D42990133

fbshipit-source-id: d6b06c40b1b959990856b46b048895e3c55a9870
  • Loading branch information
TimOliver authored and GreeMoz committed Jan 31, 2024
1 parent df83465 commit ef6a80b
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 82 deletions.
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ please open an issue on GitHub.

## Pull Requests

1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
Expand All @@ -16,7 +16,7 @@ please open an issue on GitHub.

## Experimental changes

If your change can't be unit tested, we might ask that you add your change as an experiment so that we can verify your change works. To do this, first add a new option to [IGListExperiment](https://github.com/Instagram/IGListKit/blob/master/Source/Common/IGListExperiments.h#L17).
If your change can't be unit tested, we might ask that you add your change as an experiment so that we can verify your change works. To do this, first add a new option to [IGListExperiment](https://github.com/Instagram/IGListKit/blob/main/Source/Common/IGListExperiments.h#L17).

Then, use an `experiments` bitmask wherever your change is and wrap it in a check to see if it is enabled:

Expand All @@ -30,11 +30,11 @@ Once your experiment is confirmed we will remove the option and wrapping check!

## How we do major and minor releases

Everything merges into master. When we cut a release, we merge from `master` into `stable`, tag, and push to CocoaPods.
Everything merges into `main`. When we cut a release, we merge from `main` into `stable`, tag, and push to CocoaPods.

*Example:*

If current release is `2.1.0`, then any commits for `2.2.0` go into `stable` while commits for `3.0` would go to `master`.
If current release is `2.1.0`, then any commits for `2.2.0` go into `stable` while commits for `3.0` would go to `main`.

## Testing

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## New issue checklist

- [ ] I have reviewed the [`README`](https://github.com/Instagram/IGListKit/blob/master/README.md) and [documentation](http://instagram.github.io/IGListKit)
- [ ] I have reviewed the [`README`](https://github.com/Instagram/IGListKit/blob/main/README.md) and [documentation](http://instagram.github.io/IGListKit)
- [ ] I have searched [existing issues](https://github.com/Instagram/IGListKit/issues) and this is not a duplicate
- [ ] I have attempted to reproduce the issue and include an example project.

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Issue fixed: #
- [ ] All tests pass. Demo project builds and runs.
- [ ] I added tests, an experiment, or detailed why my change isn't tested.
- [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/main/.github/CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion .github/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Here are the steps for creating and publishing a new release for `IGListKit`.
- Update pod spec version
- Update xcodeproj version
- Run `pod install` on all examples (**must happen on FB internal** because of sync issues)
- Merge `master` into `stable` via cmd-line and push
- Merge `main` into `stable` via cmd-line and push
- Confirm `stable` is `0|0` [ahead/behind](https://github.com/Instagram/IGListKit/branches)
- Create [GitHub release](https://github.com/Instagram/IGListKit/releases) from `stable`
- Paste changelog into GH release notes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "IGListKit CI"
on:
push:
branches:
- master
- main
pull_request:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ addons:

branches:
only:
- master
- main
- stable
- travis-stages

Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ This release closes the [2.1.0 milestone](https://github.com/Instagram/IGListKit
- Added support for macOS. Note: this is *only* for the Diffing components. There is **no support** for `IGListAdapter`, `IGListSectionController`, and other components at this time. [Guilherme Rambo](https://github.com/insidegui) [(#235)](https://github.com/Instagram/IGListKit/pull/235)
- Added a [macOS example](https://github.com/Instagram/IGListKit/tree/master/Examples/Examples-macOS) project. [Guilherme Rambo](https://github.com/insidegui) [(#337)](https://github.com/Instagram/IGListKit/pull/337)
- Added a [macOS example](https://github.com/Instagram/IGListKit/tree/main/Examples/Examples-macOS) project. [Guilherme Rambo](https://github.com/insidegui) [(#337)](https://github.com/Instagram/IGListKit/pull/337)
- Disables `prefetchEnabled` by default on `IGListCollectionView`. [Sven Bacia](https://github.com/svenbacia) [(#323)](https://github.com/Instagram/IGListKit/pull/323)
Expand Down Expand Up @@ -506,7 +506,7 @@ You can find a [migration guide here](https://instagram.github.io/IGListKit/migr

- Added support for cells created from nibs. [Sven Bacia](https://github.com/svenbacia) [(#56)](https://github.com/Instagram/IGListKit/pull/56)

- Added an additional initializer for `IGListSingleSectionController` to be able to support single sections created from nibs. An example can be found [here](https://github.com/Instagram/IGListKit/tree/master/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift). [(#56)](https://github.com/Instagram/IGListKit/pull/56)
- Added an additional initializer for `IGListSingleSectionController` to be able to support single sections created from nibs. An example can be found [here](https://github.com/Instagram/IGListKit/tree/main/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift). [(#56)](https://github.com/Instagram/IGListKit/pull/56)

```objc
- (instancetype)initWithNibName:(NSString *)nibName
Expand Down
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ has_doc_changes = !git.modified_files.grep(/docs\//).empty?
has_doc_gen_title = github.pr_title.include? "#docgen"
if has_doc_changes && !has_doc_gen_title
fail("Docs are regenerated when creating new releases.")
message("Docs are generated by using [Jazzy](https://github.com/realm/jazzy). If you want to contribute, please update [markdown guides](https://github.com/Instagram/IGListKit/tree/master/Guides)")
message("Docs are generated by using [Jazzy](https://github.com/realm/jazzy). If you want to contribute, please update [markdown guides](https://github.com/Instagram/IGListKit/tree/main/Guides)")
end

# Warn if Source files were added or removed but examples are not updated
Expand Down
18 changes: 9 additions & 9 deletions Guides/Best Practices and FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This guide provides notes and details on best practices in using `IGListKit`, ge

## Best Practices

- We recommend adding an assert to check [`-isKindOfClass:`](https://developer.apple.com/reference/objectivec/1418956-nsobject/1418511-iskindofclass) on the object you receive in [`-didUpdateToObject:`](https://github.com/Instagram/IGListKit/blob/master/Source/IGListSectionController.h#L63-L72) in your section controllers.
- We recommend adding an assert to check [`-isKindOfClass:`](https://developer.apple.com/reference/objectivec/1418956-nsobject/1418511-iskindofclass) on the object you receive in [`-didUpdateToObject:`](https://github.com/Instagram/IGListKit/blob/main/Source/IGListSectionController.h#L63-L72) in your section controllers.
This makes it easy to track down easily-overlooked mistakes in your [`IGListAdapaterDataSource`](https://instagram.github.io/IGListKit/Protocols/IGListAdapterDataSource.html#/c:objc(pl)IGListAdapterDataSource(im)listAdapter:sectionControllerForObject:) implementation.
If this assert is ever hit, that means `IGListKit` has sent your section controller the incorrect type of object.
This would only happen if your objects provide *non-unique* diff identifiers.
Expand Down Expand Up @@ -33,7 +33,7 @@ func didUpdate(to object: Any) {

#### I upgraded IGListKit and now everything is broken!

Check out our [migration guide](https://github.com/Instagram/IGListKit/blob/master/Guides/Migration.md) to make upgrading easier.
Check out our [migration guide](https://github.com/Instagram/IGListKit/blob/main/Guides/Migration.md) to make upgrading easier.

#### How do you implement separators between cells?

Expand All @@ -45,7 +45,7 @@ See discussion in [#316](https://github.com/Instagram/IGListKit/issues/316)

#### The documentation and examples have `<X>` feature or changes, but I don't have it in my version. Why?

This feature is on the `master` branch only and hasn't been officially tagged and [released](https://github.com/Instagram/IGListKit/releases). If you need to, you can [install from the `master` branch](https://instagram.github.io/IGListKit/installation.html).
This feature is on the `main` branch only and hasn't been officially tagged and [released](https://github.com/Instagram/IGListKit/releases). If you need to, you can [install from the `main` branch](https://instagram.github.io/IGListKit/installation.html).

#### Does `IGListKit` work with...?

Expand Down Expand Up @@ -76,7 +76,7 @@ If you have multiple thousands of items and you cannot batch them in, you'll see

#### How do I use IGListKit and estimated cell sizes with Auto Layout?

This should work in theory, and we have an [example section controller](https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/SelfSizingSectionController.swift), but the estimated-size API in `UICollectionViewFlowLayout` has changed dramatically over different iOS versions, making first-class support in IGListKit difficult. We don't use estimated cell sizes or Auto Layout in Instagram and cannot commit to fully supporting it.
This should work in theory, and we have an [example section controller](https://github.com/Instagram/IGListKit/blob/main/Examples/Examples-iOS/IGListKitExamples/SectionControllers/SelfSizingSectionController.swift), but the estimated-size API in `UICollectionViewFlowLayout` has changed dramatically over different iOS versions, making first-class support in IGListKit difficult. We don't use estimated cell sizes or Auto Layout in Instagram and cannot commit to fully supporting it.

See [#516](https://github.com/Instagram/IGListKit/issues/516) for a master list of all known issues. We very much welcome contribution to fixing this!

Expand Down Expand Up @@ -114,7 +114,7 @@ Give [this box](https://github.com/Instagram/IGListKit/issues/35#issuecomment-27

#### I want to deliver messages to certain section controllers, how do I do that?

We recommend using dependency injection and announcing changes, demonstrated in [our example](https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/ViewControllers/AnnouncingDepsViewController.swift).
We recommend using dependency injection and announcing changes, demonstrated in [our example](https://github.com/Instagram/IGListKit/blob/main/Examples/Examples-iOS/IGListKitExamples/ViewControllers/AnnouncingDepsViewController.swift).

#### Should I reuse my section controllers between models?

Expand All @@ -124,19 +124,19 @@ No! `IGListKit` is designed to have a 1:1 instance mapping between objects and s

#### Why does `UICollectionViewFlowLayout` put everything in a new row?

`UICollectionViewFlowLayout` has its limitations, and it's not well designed to support sections on the same "line". Instead you should use [`IGListCollectionViewLayout`](https://github.com/Instagram/IGListKit/blob/master/Source/IGListCollectionViewLayout.h).
`UICollectionViewFlowLayout` has its limitations, and it's not well designed to support sections on the same "line". Instead you should use [`IGListCollectionViewLayout`](https://github.com/Instagram/IGListKit/blob/main/Source/IGListCollectionViewLayout.h).

#### What if I just want a section controller and don't need the object?

Feel free to use a static string or number as your model. You can use this object as a "key" to find your section controller. Take a look at our [example](https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SearchViewController.swift#L34) of this.
Feel free to use a static string or number as your model. You can use this object as a "key" to find your section controller. Take a look at our [example](https://github.com/Instagram/IGListKit/blob/main/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SearchViewController.swift#L34) of this.

#### How do I make my cells diff and animate?

Use [`IGListBindingSectionController`](https://github.com/Instagram/IGListKit/blob/master/Source/IGListBindingSectionController.h) to automatically diff and animate your cells.
Use [`IGListBindingSectionController`](https://github.com/Instagram/IGListKit/blob/main/Source/IGListBindingSectionController.h) to automatically diff and animate your cells.

#### How can I power and update the number of items in a section controller with a dynamic array?

We recommend creating a model that owns an array to the items that power `numberOfItems`. Checkout our [Post example](https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/PostSectionController.m#L32) that has dynamic comment cells. Just be sure to check when your array changes:
We recommend creating a model that owns an array to the items that power `numberOfItems`. Checkout our [Post example](https://github.com/Instagram/IGListKit/blob/main/Examples/Examples-iOS/IGListKitExamples/SectionControllers/PostSectionController.m#L32) that has dynamic comment cells. Just be sure to check when your array changes:

```swift
class Forecast: ListDiffable {
Expand Down
4 changes: 2 additions & 2 deletions Guides/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ After installing `IGListKit`, creating a new list is easy.

Creating a new section controller is simple. Subclass `IGListSectionController` and override at least `cellForItemAtIndex:` and `sizeForItemAtIndex:`.

Take a look at [LabelSectionController](https://raw.githubusercontent.com/Instagram/IGListKit/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/LabelSectionController.swift) for an example section controller that handles a `String` and configures a single cell with a `UILabel`.
Take a look at [LabelSectionController](https://raw.githubusercontent.com/Instagram/IGListKit/main/Examples/Examples-iOS/IGListKitExamples/SectionControllers/LabelSectionController.swift) for an example section controller that handles a `String` and configures a single cell with a `UILabel`.

```swift
class LabelSectionController: ListSectionController {
Expand Down Expand Up @@ -153,7 +153,7 @@ let adapter = ListAdapter(updater: ListAdapterUpdater(),
workingRangeSize: 1) // 1 before/after visible objects
```

![working-range](https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/workingrange.png)
![working-range](https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/workingrange.png)

You can set the weak `workingRangeDelegate` on a section controller to receive events.

Expand Down
8 changes: 4 additions & 4 deletions Guides/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ In order to use the latest release of the framework, add the following to your `
pod 'IGListKit', '~> 4.0'
```

### Using `master`
### Using `main`

Alternatively, you can use the latest version from the [`master` branch](https://github.com/Instagram/IGListKit/tree/master). This is what we use at Instagram, so you can be confident that `master` is always stable and reliable.
Alternatively, you can use the latest version from the [`main` branch](https://github.com/Instagram/IGListKit/tree/main). This is what we use at Instagram, so you can be confident that `main` is always stable and reliable.

```ruby
pod 'IGListKit', :git => 'https://github.com/Instagram/IGListKit.git', :branch => 'master'
pod 'IGListKit', :git => 'https://github.com/Instagram/IGListKit.git', :branch => 'main'
```

> **Note:** while `master` is stable, it may have breaking changes. Before updating to `master`, be sure to check the [`CHANGELOG`](https://github.com/Instagram/IGListKit/blob/master/CHANGELOG.md) for details on changes.
> **Note:** while `main` is stable, it may have breaking changes. Before updating to `main`, be sure to check the [`CHANGELOG`](https://github.com/Instagram/IGListKit/blob/main/CHANGELOG.md) for details on changes.
### Subspecs

Expand Down
8 changes: 4 additions & 4 deletions Guides/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ If you were using `IGListDiff(...)` _inside_ a section controller to compute dif

You can simply find regex `IGListCollectionView([ |\*|\(])` and replace with regex `UICollectionView$1` in your project to fix this.

![Replace IGListCollectionView](https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/replace-iglistcollectionview.png)
![Replace IGListCollectionView](https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/replace-iglistcollectionview.png)

### Removed `IGListGridCollectionViewLayout`

Start using `IGListCollectionViewLayout` instead of `IGListGridCollectionViewLayout`.

- `scrollDirection` is not yet supported. If you need horizontal scrolling, please use `UICollectionViewFlowLayout` or file an issue.
- Set `minimumLineSpacing` on your [section controllers](https://github.com/Instagram/IGListKit/blob/master/Source/IGListSectionController.h#L59-L64) instead of the layout
- Set `minimumInteritemSpacing` on your [section controllers](https://github.com/Instagram/IGListKit/blob/master/Source/IGListSectionController.h#L66-L71) instead of the layout
- Return the size of your cells in [sizeForItemAtIndex:](https://github.com/Instagram/IGListKit/blob/master/Source/IGListSectionController.h#L48) instead of setting it on the layout.
- Set `minimumLineSpacing` on your [section controllers](https://github.com/Instagram/IGListKit/blob/main/Source/IGListSectionController.h#L59-L64) instead of the layout
- Set `minimumInteritemSpacing` on your [section controllers](https://github.com/Instagram/IGListKit/blob/main/Source/IGListSectionController.h#L66-L71) instead of the layout
- Return the size of your cells in [sizeForItemAtIndex:](https://github.com/Instagram/IGListKit/blob/main/Source/IGListSectionController.h#L48) instead of setting it on the layout.

### Item mutations must be wrapped in `-[IGListCollectionContext performBatchAnimated:completion:]`

Expand Down
8 changes: 4 additions & 4 deletions Guides/Modeling and Binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can follow along and build the example in this guide. First, you must downlo

Take a look at the following Instagram-inspired list element design:

![Design Specs](https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/modeling-design.png)
![Design Specs](https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/modeling-design.png)

You can already start mentally modelling your data:

Expand Down Expand Up @@ -234,7 +234,7 @@ You now have the following view models, which can all be derived from each `Post

Let's start using these models to power cells using `ListBindingSectionController`. This controller takes a top-level model (`Post`), asks its data source for an array of diffable view models (our view models above), then binds those view models to cells (provided in the starter project).

![Binding Flow](https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/binding-flow.png)
![Binding Flow](https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/binding-flow.png)

Create **PostSectionController.swift** and add the following code:

Expand Down Expand Up @@ -470,7 +470,7 @@ func listAdapter(
**Build and run** the sample app to see your post show up!

![Working in the Simulator](https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/modeling-working.png)
![Working in the Simulator](https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/modeling-working.png)

## Handling Cell Actions

Expand Down Expand Up @@ -570,7 +570,7 @@ ActionViewModel(likes: localLikes ?? object.likes)
**Build and run** the app, tap on the heart button, and see your likes increment!

<p align="center">
<img src="https://raw.githubusercontent.com/Instagram/IGListKit/master/Resources/modeling-likes.gif" width=300 />
<img src="https://raw.githubusercontent.com/Instagram/IGListKit/main/Resources/modeling-likes.gif" width=300 />
</p>

## Wrapping up
Expand Down
Loading

0 comments on commit ef6a80b

Please sign in to comment.