You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/12/24 01:03:36 UTC

[GitHub] [openwhisk-composer] starpit opened a new issue #63: implicit redis dependence causes issues with webpack builds

starpit opened a new issue #63: implicit redis dependence causes issues with webpack builds
URL: https://github.com/apache/openwhisk-composer/issues/63
 
 
   webpack scans for imports, and treats them as serious statements of dependence. openwhisk-composer has a require('redis'), but no matching dependence resolution in package.json. as a result, webpack gets a bit confused.
   
   one can place redis (and redis-commands) in the `externals` section of one's webpack configuration. but... one must do this in a blanket fashion. what if module A of my application has this implicit redis dependence, and module B has an actual (and important) dependence on redis? i cannot therefore take a blanket "externals" treatment of redis, but this is the only option i see, to patch over openwhisk-composer's unstated redis dependence.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [openwhisk-composer] tardieu commented on issue #63: implicit redis dependence causes issues with webpack builds

Posted by GitBox <gi...@apache.org>.
tardieu commented on issue #63: implicit redis dependence causes issues with webpack builds
URL: https://github.com/apache/openwhisk-composer/issues/63#issuecomment-573166857
 
 
   I am not sure I understand the issue. Redis does not appears in `package.json` dependencies because composer does not require redis. The execution of the conductor action code generated by composer may require redis, but does not require composer... The redis dependency must be satisfied by the openwhisk runtime image, not the composer install.
   
   Are you saying that webpack detects the require statement, which causes a problem for kui?
   
   I can obfuscate the `require('redis')` bit if you tell me how to fool webpack.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [openwhisk-composer] starpit commented on issue #63: implicit redis dependence causes issues with webpack builds

Posted by GitBox <gi...@apache.org>.
starpit commented on issue #63: implicit redis dependence causes issues with webpack builds
URL: https://github.com/apache/openwhisk-composer/issues/63#issuecomment-573261301
 
 
   oh, i think you can also add webpack magic comments:
   
   ```javascript
   require('/* webpackIgnore: true */ redis')
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [openwhisk-composer] tardieu closed issue #63: implicit redis dependence causes issues with webpack builds

Posted by GitBox <gi...@apache.org>.
tardieu closed issue #63: implicit redis dependence causes issues with webpack builds
URL: https://github.com/apache/openwhisk-composer/issues/63
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [openwhisk-composer] starpit commented on issue #63: implicit redis dependence causes issues with webpack builds

Posted by GitBox <gi...@apache.org>.
starpit commented on issue #63: implicit redis dependence causes issues with webpack builds
URL: https://github.com/apache/openwhisk-composer/issues/63#issuecomment-573240419
 
 
   webpack sees an import of `composer/client`, which in turn imports `./conductor`, which in turn imports (possibly) `redis`, which leads to a webpack build error.
   
   option 1) isolate the conductor and client code, so that use of the client does not chain-import conductor.js
   
   option 2) if hacks are necessary, i think you can defeat the webpack dependence crawl by doing a string-import, something like
   ```javascript
   const redis = 'redis'
   require(redis)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services