Skip to content

Doc EN : props vs "props" in passing-props for better comprehension. #1597

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 7 commits into from
Jul 13, 2017

Conversation

MachinisteWeb
Copy link
Contributor

@MachinisteWeb MachinisteWeb commented Jul 13, 2017

Use coerce word in replacement of cast — « In computer science, type conversion, type casting, and type coercion are different ways of changing an entity of one data type into another. » JavaScript use coercion, not casting : https://en.wikipedia.org/wiki/Type_conversion

Better readibility between "props" as a concept and props as the option.

That is not totaly clear for me so feel free to correct that if I do mistake on some occurences.

MachinisteWeb and others added 7 commits June 16, 2017 08:48
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Differetiate usage of `props` to speak about `props` options and "props" to speak about the props concept.

Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
@@ -59,7 +58,7 @@ const router = new VueRouter({

### Function mode

You can create a function that returns props. This allows you to cast the parameter to another type, combine static values with route-based values, etc.
You can create a function that returns props. This allows you to coerce the parameter to another type, combine static values with route-based values, etc.
Copy link
Member

Choose a reason for hiding this comment

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

You can coerce to other values, but here we still want to keep cast

Copy link
Contributor Author

@MachinisteWeb MachinisteWeb Jul 13, 2017

Choose a reason for hiding this comment

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

tl;dr => It's ok to merge like that for me :)

But

I'm not sure to well understand difference between « cast » and « coerce » :D

For me, « cast » is the action to explicitly convert a type value into another with some keyword usage.
And « coerce » is the action to implicitly convert a type value with the usage of a context or operand.

You means « with the usage of operand » is not "coercing" but is "casting" too? Even the conversion is « implicite » (no « int » or « string » keyword for example)?

Or I not understand the action behind « This allows you to cast the parameter to another type ».

So in JavaScript you coerce, in C# you cast (same for TypeScript no?)

@posva posva merged commit b84021c into vuejs:dev Jul 13, 2017
@MachinisteWeb MachinisteWeb deleted the passing-props branch July 13, 2017 14:18
kazupon added a commit to kazupon/vue-router that referenced this pull request Jul 22, 2017
posva pushed a commit that referenced this pull request Jul 22, 2017
* Add configuration settings for Caddy from #1555

* tweak consistency from #1592

* tweak consistency at installation from #1591

* tweak passin-props section from #1597

* tweak navigation-guards section from #1600

* pick up from #1596
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