Skip to content
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

refactor: client store code style #3683

Merged
merged 13 commits into from Sep 23, 2018
Merged

refactor: client store code style #3683

merged 13 commits into from Sep 23, 2018

Conversation

manniL
Copy link
Member

@manniL manniL commented Aug 10, 2018

related: #325

@codecov-io
Copy link

codecov-io commented Aug 10, 2018

Codecov Report

Merging #3683 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #3683   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files          18       18           
  Lines        1232     1232           
  Branches      337      337           
=======================================
  Hits         1201     1201           
  Misses         30       30           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc1cecf...44b8e99. Read the comment docs.

@galvez
Copy link

galvez commented Aug 25, 2018

@manniL some conflicts to fix -- is there much left to do on this?

@galvez galvez changed the title [WIP] feat: vuex store hmr feat: vuex store hmr Aug 25, 2018
@galvez galvez added the WIP label Aug 25, 2018
@manniL
Copy link
Member Author

manniL commented Aug 25, 2018

@galvez Haven't accomplished that much by now as I started digging into VueX HMR recently.

@galvez galvez assigned galvez and unassigned manniL Sep 7, 2018
@galvez
Copy link

galvez commented Sep 7, 2018

@manniL @clarkdo I fixed conflcits and added the store directory to the restart watcher, I think it's the most sensible thing to do to enhance DX here. The issue of the CLI test remains though, we need to find a way to properly check for the interactive log in unit/cli.test.js (remember @clarkdo? the issue with child_process.spawn's on('data'))

@galvez galvez removed the WIP label Sep 7, 2018
@manniL
Copy link
Member Author

manniL commented Sep 7, 2018

I think that's not it. I think the request was to HMR modules directly (not the whole page when they change 🤔). However, it's a great step in the correct direction

@galvez galvez added the WIP label Sep 20, 2018
lib/app/store.js Outdated
storeData.modules = {}
}
// Recursive find files in {srcDir}/{dir.store}
files = require.context('@/<%= dir.store %>', true, /^\.\/(?!<%= ignorePrefix %>)[^.]+\.(<%= extensions %>)$/)
Copy link
Member Author

Choose a reason for hiding this comment

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

Why do you prefer an "external variable" instead of a const here?

Copy link

Choose a reason for hiding this comment

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

@manniL store needed to be available in L130

lib/app/store.js Outdated
// Recursive find files in {srcDir}/{dir.store}
const files = require.context('@/<%= dir.store %>', true, /^\.\/(?!<%= ignorePrefix %>)[^.]+\.(<%= extensions %>)$/)
const filenames = files.keys()

// Store
Copy link
Member Author

Choose a reason for hiding this comment

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

We could actually remove that comment as it doesn't add any value, right?

lib/app/store.js Outdated
// createStore
let store
Copy link
Member Author

Choose a reason for hiding this comment

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

Why do you prefer an "external variable" instead of a const (or an inline return if it doesn't add any value) here?

@galvez galvez changed the title feat: vuex store hmr refactor: client store Sep 20, 2018
@galvez galvez added post-2.0 and removed post-2.0 labels Sep 20, 2018
@galvez galvez removed the WIP label Sep 23, 2018
@galvez
Copy link

galvez commented Sep 23, 2018

@pi0 @manniL @clarkdo k, without the unnecessary HMR changes, which I removed, it's back to the original set of refactorings, minus unneeded comments, plus minor lint edits. Feel free to get this in as-is.

@pi0 pi0 changed the title refactor: client store refactor: client store code style Sep 23, 2018
@pi0 pi0 merged commit 054ea79 into nuxt:dev Sep 23, 2018
@manniL manniL deleted the store-hmr branch September 23, 2018 22:46
@lock
Copy link

lock bot commented Oct 31, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants