Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Conversation

kdmccormick
Copy link
Contributor

@kdmccormick kdmccormick commented Jul 8, 2021

Should allow installation of local versions of NPM
packages via module.config.js, allowing frontend devs
to test out frontend library changes within devstack.


State

  • This does successfully mount the folders into each frontend using the default local-mounts strategy.
  • I haven't tested this using the NFS strategy; I think I'll need someone with a Mac to try that.
  • I get an error when I actually try to load a frontend using the local JS packages.

This is a PR into another PR: https://github.com/edx/devstack/pull/783

@kdmccormick
Copy link
Contributor Author

@davidjoy So, wildcarding does not seem to be an option with docker-compose mounts :(

Here is my attempt at the approach as we discussed the other day. Adding a new package to the mounts would involve changing microfrontend.yml in three places.

I haven't actually gotten it to work -- I keep getting:

./src/index.scss (./node_modules/css-loader/dist/cjs.js??ref--5-1!./node_modules/postcss-loader/src??ref--5-2!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--5-4!./src/index.scss)
SassError: Can't find stylesheet to import.
  ╷
1 │ @import "~bootstrap/scss/functions";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../paragon/scss/core/_functions.scss 1:9  @import
  ../paragon/scss/core/core.scss 1:9        @import
  src/index.scss 3:9                        root stylesheet

when I try to navigate to frontend-app-learning, even though npm run build passes.

I also haven't tested it with NFS -- I think I'd need someone else to do that for me.

@davidjoy
Copy link

davidjoy commented Jul 9, 2021

Are you running npm run build in paragon before trying to run anything in the frontend-app-learning MFE? That looks like what you get if you haven't built paragon first... (not sure which npm run build you're referring to above - if that's paragon and it's still not working, something else is going on... 🤔)

@kdmccormick
Copy link
Contributor Author

@davidjoy ooh, I ran npm run build in just frontend-app-learning; let my try it in the JS packages too.

@kdmccormick
Copy link
Contributor Author

@davidjoy It works! My process:

  • Run npm install & npm run build in each local package, locally (although probably would have worked in the container as well).
  • Shell into the frontend-app container with make frontend-app-blah-shell and run npm install
  • Attached to the frontend-app container with make frontend-app-blah-attach and restarted the node devserver with Ctrl+C.

So, the only blockers to merging this would be:

@kdmccormick kdmccormick force-pushed the kdmccormick/service-names-and-dependencies branch from d7bbc3b to ca727ba Compare July 27, 2021 14:16
Should allow installation of local versions of NPM
packages via module.config.js, allowing frontend devs
to test out frontend library changes within devstack.
@kdmccormick kdmccormick force-pushed the kdmccormick/service-names-and-dependencies-frontend-mounts-2 branch from 5d6efed to 7f981f6 Compare July 27, 2021 18:56
@kdmccormick
Copy link
Contributor Author

Closed in favor of https://github.com/edx/devstack/pull/803/files

@kdmccormick kdmccormick deleted the kdmccormick/service-names-and-dependencies-frontend-mounts-2 branch July 27, 2021 18:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants