Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Merge meta fields from parent to child #144

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 3 commits into from
Apr 1, 2020

Conversation

posva
Copy link
Member

@posva posva commented Mar 12, 2020

@posva posva added breaking change This RFC contains breaking changes or deprecations of old API. router 3.x This RFC only targets 3.0 and above labels Mar 12, 2020
@KaelWD
Copy link

KaelWD commented Mar 12, 2020

I believe this is what Nuxt does

vue-meta?

@kiaking
Copy link
Member

kiaking commented Mar 12, 2020

I like this one. It's going to make meta accessing much easier 🙌

One question. Why is nested key removed in "Basic example" section's example, and not in "Detailed design" section's example?

{
  path: '/parent',
  meta: { nested: { requiresAuth: true, isChild: false } },
  children: [
    { path: 'child', meta: { isChild: true }}
  ]
}

// becomes
{ requiresAuth: true, isChild: true }

And

{
  path: '/parent',
  meta: { nested: { a: true } },
  children: [
    { path: 'child', meta: { nested: { b: true }}}
  ]
}

// becomes
{
  nested: {
    b: true
  }
}

Wouldn't the first example become as below?

{
  nested: {
    requiresAuth: true,
    isChild: true
  },
  isChild: false
}

Or, is nested key means something special?

@posva
Copy link
Member Author

posva commented Mar 12, 2020

Thanks @kiaking That was indeed a mistake. I fixed it

@posva
Copy link
Member Author

posva commented Mar 28, 2020

This RFC is now in final comments stage. An RFC in final comments stage means that:

The core team has reviewed the feedback and reached consensus about the general direction of the RFC and believe that this RFC is a worthwhile addition to the framework.
Final comments stage does not mean the RFC's design details are final - we may still tweak the details as we implement it and discover new technical insights or constraints. It may even be further adjusted based on user feedback after it lands in an alpha/beta release.
If no major objections with solid supporting arguments have been presented after a week, the RFC will be merged and become an active RFC.

@posva posva added the final comments This RFC is in final comments period label Mar 28, 2020
@posva posva merged commit f3fed80 into vuejs:master Apr 1, 2020
@posva posva deleted the router/meta-merging branch April 1, 2020 12:12
@Rolanddoda
Copy link

The rendered link gives 404

@ludohenin
Copy link

ludohenin commented Apr 13, 2020

I may jump into that one a bit late but in my case merging meta doesn't sound that great.
I mainly use the meta to hold the document title and use it to build it as a tree.

'/'                // title = App name
  'settings'       // title = Setting - App name
    'users'        // title = Users - Settings - App name

As merging the meta.title will break this how to then implement such feature.

@posva
Copy link
Member Author

posva commented Apr 13, 2020

@ludohenin Since you need all values from meta to create your tree, you probably go through the array of matched like it's shown on documentation. That array is kept the same, only the to.meta and from.meta properties are the results of merging parent to child meta properties, the ones at to.matched and from.matched are the originals

@ludohenin
Copy link

@posva ah OK, perfect then ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x This RFC only targets 3.0 and above breaking change This RFC contains breaking changes or deprecations of old API. final comments This RFC is in final comments period router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.