Comments (4)
I have investigated this issue with our application. I found why this issue surfaces only in production mode.
In Mendel V1, we were able to catch these issues in dev mode. Since we have daemon in Mendel V2 (to boost developer productivity). Now, daemon caches all modules so resolving dependencies is always smooth.
It is hard to resolve cyclic dependencies in runtime (same with other libraries), we should show a warning to developers for such cases. This will help in catching these issues very early.
from mendel.
I think this can be implement in the client, specially because this is on a per bundle request. I think deamon is correct so far. Deamon job is to get a bunch of source files and do all the transforms, watching file system, etc. If the dependency is circular or not depends on bundle resolution.
I am curious tho that in development the issue does not exist. Were you able to diagnose why development works well?
from mendel.
In production during server side rendering, mendel tries to resolve all dependencies. In mendel-loader/resolver.js file, we store incomplete module in cache. If other files request for this module before mendel internal cache gets updated, they get only incomplete module.
This doesn't happen in development mode, since daemon stores all complete modules in its cache. I am yet to fully investigate why dev works fine, please let me know if my hypothesis is wrong.
from mendel.
I think it makes sense.
But on the other hand, I remember @gomezd implementing this, and there was a notion of testing to see if the request is ready. Since the middleware is async, it is possible to wait for it to be ready.
This way, during SSR, you can hold until the resolver is ready and call the code only once incomplete module is done.
We might need to expose to the middleware some sort of listener. I don't know how development middleware deals with it exactly, but I think it waits for the sync event from the daemon.
from mendel.
Related Issues (20)
- [meta] Improve full-example restart
- Tests break as mendel-mocha doesnt support to require setup files HOT 2
- Cannot run full-example in production mode HOT 2
- SSR is not working in full-example when using a fresh clone of the repo HOT 1
- Daemon process throws errors for 3rd party transforms HOT 8
- global is not defined error running full-example from fresh repo clone HOT 1
- Move all of mendel-development that is still used in 3.x out of this package and kill mendel-development
- Middleware client should not crash app when client code is invalid
- Pickup new node_modules/ when they are installed
- mendel-daemon is terminated because of memory issue HOT 2
- Documentation and Discussion HOT 1
- Mendel and Webpack HOT 1
- Assigning experiments HOT 2
- Different files that yield same `normalizedId` collisions are not detected, production issues HOT 1
- Migrate from `linkall.js` to `learna` for monorepo menagement HOT 1
- Mendel Daemon should watch .mendelrc or package.json and soft restart
- JS File that only exists on variation should be picked up
- New dependency name: uglify-es => terser #1 HOT 2
- CSS File that only exists on variation is being picked up by base variation in production build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mendel.