adobe-dx icon indicating copy to clipboard operation
adobe-dx copied to clipboard

fix relative paths to react (at least in admin)

Open npeltier opened this issue 4 years ago • 2 comments

out of GH-121, here is instruction to reproduce that issue looks like if you move the build, things don't work anymore (as you could expect with hardcoded relative paths, but it does work for content & structure):

  1. build the whole project
  2. cd apps/admin
  3. mvn clean install && cd target && git clone --depth 1 --branch master [email protected]:adobe/adobe-dx.git checkout && cd checkout

from there if you cd apps/admin/app and run the build of the app, you'll have failure, if you do the same for structure or content, it will work. We need to find a way to stop using static hardcoded paths, as we need those both context to work (this checkout context is what is done when doing a release:perform)

npeltier avatar Jul 03 '20 16:07 npeltier

This is solved for now, but I think there's a more global / dynamic way to solve this issue.

For now there might be a way to use a maven profile to kick off a different npm script that would pull react from a different location. I think the root issue was related to some internal react spectrum things trying to run and dying because react was not in apps/admin/app/node_modules. The solution would most likely be:

  1. A new release profile that runs a different NPM script - <arguments>run build-release</arguments>
  2. This would tell NPM to run with a different set of arguments that could be interpreted by webpack - "build-release": "NODE_ENV=production webpack --mode=production --react=local",
  3. Webpack would pick this change up to change where react is located.

auniverseaway avatar Jul 08 '20 16:07 auniverseaway

happens again on admin app, hence re-opening, i guess we should go for the long term fix you're proposing @auniverseaway

npeltier avatar Sep 28 '20 09:09 npeltier