8000 [changed] collapsable => collapsible property by AlexKVal · Pull Request #609 · react-bootstrap/react-bootstrap · GitHub
[go: up one dir, main page]

Skip to content

[changed] collapsable => collapsible property #609

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

Merged
merged 2 commits into from
May 4, 2015

Conversation

AlexKVal
Copy link
Member
@AlexKVal AlexKVal commented May 3, 2015

Restored branch for #603.

I was cleaning up my branches and accidentally removed AlexKVal:collapsiblePro branch
and #603 was automatically closed by GitHub :)
And I have not found a way to re-open it.

Closes #425

);
}
return React.PropTypes.bool.call(null, props, propName, componentName);
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not see deprecation specific warnings here as it will cause this file to churn a lot. How about putting this in it's own file? Then when it's time to remove this old logic it's as simple as deleting some files with little footprint of code files that will be retained.

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem. I was asking about it here #425 (comment), but it seems I'm asking a lot of questions in a row and some of them are lost 😄

@AlexKVal
Copy link
Member Author
AlexKVal commented May 4, 2015

No problem.
I will move those tests and then rebase all with 608 into one PR with two commits.

AlexKVal added 2 commits May 4, 2015 23:06
When deprecated `Collaps_a_bleNav` is imported
it also tags `Collaps_i_bleNav` element as deprecated, because
it is done by using pointers which points to the same object.

```js
let CollapsableNav = CollapsibleNav;
CollapsableNav.__deprecated__ = true;
```
https://github.com/react-bootstrap/react-bootstrap/blob/92c57ef7ee/src/CollapsableNav.js#L5

The right and simplest way to make deprecation
in the case of component renaming `CollapsableNav => CollapsibleNav`
by using general for both components part - `classSpecifications`.

Like this:

```js
// NewNameComponent.js
const classSpecificationsFor_NewNameComponent = { /* existing code */ };
const NewNameComponent =
  React.createClass( classSpecificationsFor_NewNameComponent );
export {classSpecificationsFor_NewNameComponent}; // for old component
export default NewNameComponent;

// OldNameComponent.js
import {classSpecificationsFor_NewNameComponent} from 'NewNameComponent';
const classSpecsFor_OldNameComponent =
  assign({}, classSpecificationsFor_NewNameComponent, {
  // here we add deprecation warning
  });
const OldNameComponent =
  React.createClass( classSpecsFor_OldNameComponent );
export default OldNameComponent;
```
Discussion is here react-bootstrap#425.

Components are involved:
- Nav
- Panel
- CollapsibleNav

Current property type checking for `collapsable` in `PanelGroup`
is needless and has been removed.

Tests for deprecated `collapsable` property for all three components
has been placed into one file `CollapsableNavSpec.js`
@AlexKVal AlexKVal force-pushed the collapsibleProp branch from 0d7835e to 51a205f Compare May 4, 2015 20:10
@AlexKVal
Copy link
Member Author
AlexKVal commented May 4, 2015

Done.

Off-topic: collapsable deprecation was enough "collapsing" between files and git-branches 😃

@AlexKVal
Copy link
Member Author
AlexKVal commented May 4, 2015

In case this PR is merged, we should re-apply @tacomanator work #536

I've merged it all locally and checked. All is green now.

@mtscout6
Copy link
Member
mtscout6 commented May 4, 2015

Wait #536 was reverted? Why were these collapsable changes breaking that to cause a revert.

@mtscout6
Copy link
Member
mtscout6 commented May 4, 2015

Ok, I see what's going on now. I'll get this sorted out real quick.

mtscout6 added a commit that referenced this pull request May 4, 2015
[changed] collapsable => collapsible property
@mtscout6 mtscout6 merged commit 7ca032c into react-bootstrap:master May 4, 2015
Sign up for free to join this conversation on GitHub 5E16 . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapsable => collapsible
2 participants
0