Skip to content

Commit

Permalink
Move ViewComponent to separate GitHub organization (#1496)
Browse files Browse the repository at this point in the history
* Move ViewComponent to separate GitHub organization.
Closes #1424

* fix typo

* merge conflict

* fix lint

* Update docs/CONTRIBUTING.md

Co-authored-by: Richard Macklin <[email protected]>

* Update docs/CHANGELOG.md

Co-authored-by: Richard Macklin <[email protected]>

Co-authored-by: Richard Macklin <[email protected]>
  • Loading branch information
joelhawksley and rmacklin authored Aug 31, 2022
1 parent 978e1dc commit 92a0f39
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/github/view_component/discussions
url: https://github.com/viewcomponent/view_component/discussions
about: Ask questions and discuss with other community members
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ nav_order: 5

## main

**ViewComponent has moved to a new organization: [https://github.com/viewcomponent/view_component](https://github.com/viewcomponent/view_component). See [https://github.com/viewcomponent/view_component/issues/1424](https://github.com/viewcomponent/view_component/issues/1424) for more details.**

## 2.70.0

* `render_preview` can pass parameters to preview.
Expand Down
10 changes: 5 additions & 5 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ _ViewComponent is intended to be a safe, welcoming space for collaboration. By p

Hi there! We're thrilled that you'd like to contribute to ViewComponent. Your help is essential for keeping it great.

If you have any substantial changes that you would like to make, please [open an issue](https://github.com/github/view_component/issues/new) first to discuss them with us.
If you have any substantial changes that you would like to make, please [open an issue](https://github.com/viewcomponent/view_component/issues/new) first to discuss them with us.

Maintainers tend to focus on areas of the project that are useful to them and their employers, but we're happy to pair with members of the community to enable work on other parts.

Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [MIT license](https://github.com/github/view_component/blob/main/LICENSE.txt).
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [MIT license](https://github.com/viewcomponent/view_component/blob/main/LICENSE.txt).

## Reporting bugs

Expand All @@ -41,14 +41,14 @@ The codespace environment includes a minimal Rails app with ViewComponent instal

## Submitting a pull request

1. [Fork](https://github.com/github/view_component/fork) and clone the repository.
1. [Fork](https://github.com/viewcomponent/view_component/fork) and clone the repository.
1. Configure and install the dependencies: `bundle exec appraisal install`.
2. Make sure the tests pass: `bundle exec appraisal rake` (see below for specific cases).
3. Create a new branch: `git checkout -b my-branch-name`.
4. Add tests, make the change, and make sure the tests still pass.
5. Add an entry to the top of `docs/CHANGELOG.md` for the changes, no matter how small.
6. If it's your first time contributing, add yourself to `docs/index.md`.
7. Push to the fork and [submit a pull request](https://github.com/github/view_component/compare).
7. Push to the fork and [submit a pull request](https://github.com/viewcomponent/view_component/compare).
8. Wait for the pull request to be reviewed and merged.

### Running a subset of tests
Expand All @@ -61,7 +61,7 @@ bundle exec m test/view_component/YOUR_COMPONENT_test.rb:line_number

### Running tests for a specific version of Rails

Specify one of the supported versions listed in [Appraisals](https://github.com/github/view_component/blob/main/Appraisals):
Specify one of the supported versions listed in [Appraisals](https://github.com/viewcomponent/view_component/blob/main/Appraisals):

```command
bundle exec appraisal rails-5.2 rake
Expand Down
4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ color_scheme: custom
logo: "/logo/viewcomponent-color-logo.svg"
aux_links:
"ViewComponent on GitHub":
- "https://github.com/github/view_component"
- "https://github.com/viewcomponent/view_component"
aux_links_new_tab: true

# Exclude from processing.
Expand All @@ -56,7 +56,7 @@ aux_links_new_tab: true
# Footer "Edit this page on GitHub" link text
gh_edit_link: true # show or hide edit this page link
gh_edit_link_text: "Edit this page on GitHub"
gh_edit_repository: "https://github.com/github/view_component" # the github URL for your repo
gh_edit_repository: "https://github.com/viewcomponent/view_component" # the github URL for your repo
gh_edit_branch: "main" # the branch that your docs is served from
gh_edit_source: docs # the source that your files originate from
gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately
2 changes: 1 addition & 1 deletion docs/adrs/0004-slots-separate-getter-setter.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
c = MyComponent.new

# c.header returns nil because the getter path is being executed due to having
# no arguments and no block passed: https://github.com/github/view_component/blob/main/lib/view_component/slotable_v2.rb#L70-L74
# no arguments and no block passed: https://github.com/viewcomponent/view_component/blob/main/lib/view_component/slotable_v2.rb#L70-L74
#
c.header.with_content("Hello world!") # undefined method `with_content' for nil:NilClass (NoMethodError)
```
Expand Down
6 changes: 3 additions & 3 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ nav_order: 6

## Ruby & Rails

ViewComponent is [supported natively](https://edgeguides.rubyonrails.org/layouts_and_rendering.html#rendering-objects) in Rails 6.1, and compatible with Rails 5.0+ via an included [monkey patch](https://github.com/github/view_component/blob/main/lib/view_component/render_monkey_patch.rb).
ViewComponent is [supported natively](https://edgeguides.rubyonrails.org/layouts_and_rendering.html#rendering-objects) in Rails 6.1, and compatible with Rails 5.0+ via an included [monkey patch](https://github.com/viewcomponent/view_component/blob/main/lib/view_component/render_monkey_patch.rb).

ViewComponent is tested for compatibility [with combinations of](https://github.com/github/view_component/blob/22e3d4ccce70d8f32c7375e5a5ccc3f70b22a703/.github/workflows/ruby_on_rails.yml#L10-L11) Ruby v2.5+ and Rails v5+. Ruby 2.4 is likely compatible, but is no longer tested.
ViewComponent is tested for compatibility [with combinations of](https://github.com/viewcomponent/view_component/blob/22e3d4ccce70d8f32c7375e5a5ccc3f70b22a703/.github/workflows/ruby_on_rails.yml#L10-L11) Ruby v2.5+ and Rails v5+. Ruby 2.4 is likely compatible, but is no longer tested.

## Template languages

Expand All @@ -21,7 +21,7 @@ ViewComponent is tested against ERB, Haml, and Slim, but it should support most
Since 2.13.0
{: .label }

To [avoid conflicts](https://github.com/github/view_component/issues/288) between ViewComponent and other gems that also monkey patch the `render` method, it's possible to configure ViewComponent to not include the render monkey patch:
To [avoid conflicts](https://github.com/viewcomponent/view_component/issues/288) between ViewComponent and other gems that also monkey patch the `render` method, it's possible to configure ViewComponent to not include the render monkey patch:

`config.view_component.render_monkey_patch_enabled = false # defaults to true`

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ProductComponent < ViewComponent::Base
end
```

[By default](https://github.com/github/view_component/blob/89f8fab4609c1ef2467cf434d283864b3c754473/lib/view_component/base.rb#L249), the component name is used to define the parameter passed into the component from the collection.
[By default](https://github.com/viewcomponent/view_component/blob/89f8fab4609c1ef2467cf434d283864b3c754473/lib/view_component/base.rb#L249), the component name is used to define the parameter passed into the component from the collection.

## `with_collection_parameter`

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ViewComponents use a standard Ruby initializer that clearly defines what's neede

### Performance

Based on several [benchmarks](https://github.com/github/view_component/blob/main/performance/benchmark.rb), ViewComponents are ~10x faster than partials in real-world use-cases.
Based on several [benchmarks](https://github.com/viewcomponent/view_component/blob/main/performance/benchmark.rb), ViewComponents are ~10x faster than partials in real-world use-cases.

The primary optimization is pre-compiling all ViewComponent templates at application boot, instead of at runtime like traditional Rails views.

Expand Down Expand Up @@ -229,8 +229,8 @@ ViewComponent is built by over a hundred members of the community, including:
* [Within3](https://www.within3.com/)
* [Wrapbook](https://wrapbook.com/)

Using ViewComponent? [Send a pull request](https://github.com/github/view_component/edit/main/docs/index.md) to update this list!
You can also check out [how various projects use ViewComponent](https://github.com/github/view_component/network/dependents?package_id=UGFja2FnZS0xMDEwNjQxMzYx).
Using ViewComponent? [Send a pull request](https://github.com/viewcomponent/view_component/edit/main/docs/index.md) to update this list!
You can also check out [how various projects use ViewComponent](https://github.com/viewcomponent/view_component/network/dependents?package_id=UGFja2FnZS0xMDEwNjQxMzYx).

<hr />

Expand Down
4 changes: 2 additions & 2 deletions docs/known_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ nav_order: 9

## form_for compatibility

ViewComponent [isn't compatible](https://github.com/github/view_component/issues/241) with `form_for` helpers by default.
ViewComponent [isn't compatible](https://github.com/viewcomponent/view_component/issues/241) with `form_for` helpers by default.

## Inconsistent controller rendering behavior between Rails versions

In versions of Rails < 6.1, rendering a ViewComponent from a controller doesn't include the layout.

## Forms don't use the default form builder

Calls to form helpers such as `form_with` in ViewComponents [don't use the default form builder](https://github.com/github/view_component/pull/1090#issue-753331927). This is by design, as it allows global state to change the rendered output of a component. Instead, consider passing a form builder into form helpers via the `builder` argument:
Calls to form helpers such as `form_with` in ViewComponents [don't use the default form builder](https://github.com/viewcomponent/view_component/pull/1090#issue-753331927). This is by design, as it allows global state to change the rendered output of a component. Instead, consider passing a form builder into form helpers via the `builder` argument:

```html.erb
<%= form_for(record, builder: CustomFormBuilder) do |f| %>
Expand Down
2 changes: 1 addition & 1 deletion docs/slots_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ By default, slots can be rendered once per component. They provide an accessor w

Slots declared with `collection: true` can be rendered multiple times. They provide an accessor with the pluralized name of the slot (`#rows`), which is an Array of `ViewComponent::Slot` instances.

To learn more about the design of the Slots API, see [#348](https://github.com/github/view_component/pull/348) and [#325](https://github.com/github/view_component/discussions/325).
To learn more about the design of the Slots API, see [#348](https://github.com/viewcomponent/view_component/pull/348) and [#325](https://github.com/viewcomponent/view_component/discussions/325).

## Defining Slots

Expand Down
2 changes: 1 addition & 1 deletion script/release
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ push() {
echo "####################################################"
echo "Now, open a PR with this branch and merge it to main"
echo "Then, run script/publish on main to release the gem"
echo "Finally, create a GitHub release https://github.com/github/view_component/releases/new with the changes from docs/CHANGELOG"
echo "Finally, create a GitHub release https://github.com/viewcomponent/view_component/releases/new with the changes from docs/CHANGELOG"
echo "####################################################"
}

Expand Down
2 changes: 1 addition & 1 deletion script/replicate-bug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bundle config local.view_component $(pwd)
rails new --minimal replicate-bug
cd replicate-bug
# Add our local copy of ViewComponent
bundle add view_component --git https://github.com/github/view_component --branch $branch_name
bundle add view_component --git https://github.com/viewcomponent/view_component --branch $branch_name
# Generate a controller
rails g controller Home index
# Generate ApplicationComponent, assuming most folks use it.
Expand Down

0 comments on commit 92a0f39

Please sign in to comment.