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

Remove Javascript 3rd-party dependencies from the Knetminer codebase #366

Closed
marco-brandizi opened this issue Jul 4, 2019 · 6 comments
Closed
Assignees
Labels
enhancement Use this for a change about existing functionality, use 'new feature' for new functionality. project:client Related to the client/front-end war.

Comments

@marco-brandizi
Copy link
Member

marco-brandizi commented Jul 4, 2019

I've just copied my local clone of the Knetminer codebase and I realised there are directories with huge size, which seem to contain 3rd-party Javascript dependencies, eg, node_modules. This slows down operations like copies and Docker builds.

We should improve this and put those files out of our code base. One way to do it might be to see if there are already published Maven modules that could be linked from our POMs. Or, if no such thing exists, we could create separated Maven modules and link them.

@marco-brandizi marco-brandizi added project:client Related to the client/front-end war. enhancement Use this for a change about existing functionality, use 'new feature' for new functionality. labels Jul 4, 2019
@AjitPS
Copy link
Collaborator

AjitPS commented Aug 7, 2019

for both Genomaps/ and KnetMaps/ in common/client-base/, fyi

@marco-brandizi
Copy link
Member Author

After some investigation, this should be a reasonable plan.

Javascript refactoring

Work on the original Javascript repositories, KnetMaps and GenoMaps. For each of them:

  1. Move everything about Bower into the NPM package list and build. This is hardly automatable, but there
    is a guideline.
  2. Upgrade Gulp and NPM versions.
  3. Upgrade dependencies in Gulp and NPM. Use a similar approach of changing version one dependency at
    a time and see if it works.
  4. Ensure the Gulp/NPM files can build distribution files (in dist/) and add a build step to publish these files
    into the NPM registry. If the latter is not viable, just publish back on the package github repository.
  5. Once everything works, automate the build via GitHub Actions. Consider the approach we already have in
    place for Java (here). This might be done after the KnetMiner refactorisation (see below)

KnetMiner refactorisation

Once the Js repo is re-arranged and can publish distro files, Go to KnetMiner and make client-base dependant on the distro only. At the moment this module has duplicates of both repositories and rebuilds everything (with bower, NPM, etc) during the Maven build. Clearly, this is redundant and needs to be factories. So,

  1. we need to remove the Maven build steps that reproduce the Js process outlined in the previous section,
  2. we need to remove non-distro files and
  3. we need a different Maven build procedure that just downloads the distribution files into target/, thus preparing the .war building stage.

@marco-brandizi
Copy link
Member Author

I've checked out the work done so far for knemap.js. Sounds good, I'm leaving just a few notes, in case it's useful to keep track of them:

  • css/knet-style.css: any reason why background-color: white was changed to #FFF?

  • When I rebuild the NPM packaging, the commandnpm install --package-lock yields many deprecated
    warnings, including a mention that bower is deprecated. Is this because of transitive dependencies?
    we should address these warnings at some point, for the moment, let's complete the re-organisation, including knetminer/client-base

  • As per documentation, It should be possible to use the repository as-is (without even
    pushing dist/). When refactoring client-base, let's first try this option (ie, link knetmaps.js and
    genomaps.js via github URL), we'll use NPM registry if this doesn't work.

  • Both README files and documentation need to reflect these recent changes at some point (TODO
    warning added).

@Arnedeklerk
Copy link
Member

@manlikleo please close if completed.

@marco-brandizi
Copy link
Member Author

marco-brandizi commented Dec 5, 2022

This is practically completed, except for a few minor details:

@Arnedeklerk
Copy link
Member

@marco-brandizi @lawal-olaotan please close if done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Use this for a change about existing functionality, use 'new feature' for new functionality. project:client Related to the client/front-end war.
Projects
None yet
Development

No branches or pull requests

4 participants