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

Dynamically load JS modules #5

Open
dannymk opened this issue Jan 19, 2017 · 0 comments
Open

Dynamically load JS modules #5

dannymk opened this issue Jan 19, 2017 · 0 comments

Comments

@dannymk
Copy link

dannymk commented Jan 19, 2017

Hi Aaaron,
I took your "The Ins & Outs of the Newest JavaScript: ES6" @ Udemy. It was great, you are a very good presenter and explained the material very well.

I've had this lingering question quite a while. How do I support dynamic module upload. I think it is best to give you a scenario:

  1. ES6 SPA "application-a" running on page. Application state is maintained using Redux.
  2. User "A" uploads "dyn_module.js" to website running in step 1
  3. applicaiton-a "polls/receives message/etc..." server for new modules in "well known" directory
  4. application-a loads module(s) and may dynamically establish a route that immediately becomes available in step 1.

For a moment, lets take security out of the picture as I understand the risks from that perspective.
The point is that we never know when "dyn_module.js" will be available. We don't know the module name or functionality. All we know is the well known directory on the server where the modules will be available and that we may get these uploaded/updated at any point in time while the application is running.

Solutions I have thought about:

  • Run a process on the server that repackages everything into a new app if a new file is detected. Refresh SPA in browser...

My current development environment:
React/Aurelia
Redux
WebPack

Thank you for your time. I know you are a busy guy.

Dan.

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

No branches or pull requests

1 participant