question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any examples of production codebases without dynamic modules?

See original GitHub issue

I’m having troubles with dynamic modules (something wrong with my getModule() calls not returning the right thing), but I don’t need them to be dynamic. Is there a good example with a few modules where they’re not dynamic? It would help to see a whole working system.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
garyocommented, Sep 26, 2019

Wow, I got it working! Thanks @danielroe !

  • Have to re-export UserModule from store-accessor and import from there into store/index.ts (don’t try to import it from user.ts and import into store/index.ts)

Then the proper export stanza in store/index.ts is this:

export default new Store({
  plugins, // missing from doc, but needed
  modules: {'user': userModule}, // all modules here
  state: {},
  mutations: {},
  actions: {}
})

I’ve updated my repo above – and I’d be happy to include this in the docs if you think that’s a good idea. (It took me a lot of hair-pulling to get to this state!)

0reactions
danielroecommented, Sep 26, 2019
export default new Store({
  plugins,
  modules: [], // add your modules here
  state: {},
  mutations: {},
  actions: {}
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common modularization patterns - Android Developers
This page gives an overview of some general rules and common patterns that you can employ when developing multi module Android apps.
Read more >
Using Native JavaScript Modules in Production Today
The module test example it studied consisted of unoptimized and unminified ... You can do all of that and still use modules in...
Read more >
Scaling Slack's Mobile Codebases: Modularization
We use the word 'module' to describe a subproject — generally a static or dynamic framework linked into the app. Prior to Duplo,...
Read more >
Python at Scale: Strict Modules - Instagram Engineering
Strict modules place some limitations on what can happen at module top-level. All module-level code, including decorators and functions/ ...
Read more >
Dynamic Feature Modules in a Production App
Remove shrinkResources from app.gradle; Modular Codebase: The most ... It is important to name the module in the format com.example.modulename and not ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found