Skip to content

Conversation

Akryum
Copy link
Member

@Akryum Akryum commented Jan 27, 2018

New SharedData system that automatically synchronize data between the devtools and the backend, with persisting capabilities. Data is reactive in Vue apps.

Currently holds:

@Akryum Akryum changed the title Shared-data: classifyComponent, openInEditorHost SharedData: classifyComponent, openInEditorHost Jan 27, 2018
@Akryum Akryum self-assigned this Jan 27, 2018
@Akryum Akryum added this to the v4.2.0 milestone Jan 27, 2018
@Akryum
Copy link
Member Author

Akryum commented Jan 27, 2018

Here is the doc for openInEditorHost:


Customize request

You can change the request host (default /) with the following code in your frontend app:

// App served from port 4000
// Webpack dev server on port 9000
Vue.config.devtoolsConfig = {
  openInEditorHost: 'http://localhost:9000/'
}

@Akryum
Copy link
Member Author

Akryum commented Jan 27, 2018

This may need Vue typings update.

@Akryum
Copy link
Member Author

Akryum commented Jan 30, 2018

@evan Changed to window.VUE_DEVTOOLS_CONFIG

mathieutu added a commit to mathieutu/laravel-mix-editor that referenced this pull request Jan 30, 2018
Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

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

One suggestion, but overall LGTM 🚀

// Load persisted fields
if (persist) {
persist.forEach(key => {
const value = storage.get(`shared-data:${key}`)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should use less generic storage key? Additional vue related prefix would rather be enough :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is done on the devtools side, and thus the localStorage is already specific to the extension.

@ElMassimo
Copy link

What's the timeline on this? Would be pretty useful for anyone using Webpacker to mount a Vue app in their Rails application.

@Akryum Akryum merged commit 7868342 into vuejs:master Jul 26, 2018
@Akryum Akryum deleted the shared-data branch July 26, 2018 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants