Skip to content

Extract uuid to a separate file #72

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lagartoverde
Copy link

Description

This extracts the uuid package and uuid export to a separate file.

Motivation

One of the main problems that the GN team has faced with the javascript template is that if you import anything from the 'mu' package it spins up a server, which is not always desirable, for example while running the tests of your microservice. I will try to address this problem in a future PR by making the server spin up when the microservice starts running instead of when you import from 'mu'.
On the meantime our workaround has been to import the code we needed from the individual files instead for example importing the helpers from 'mu/sparql'. This approach is not possible for the uuid as it's defined and exported in the index.js file. Which leads to the solution being using the main uuid package directly. This solution has many drawbacks and I think diverges from what the mu-javascript-template wants to do (unify the ecosystem).
So what I propose is to extract the uuid export to a new file so we can keep consistent with our workaround while not impacting the other users of the templte until we solve the main problem which I think will take a while
Thanks for coming to my TED talk.

Testing

Basically this PR should have no impact to the normal use of the template, but now you should be able to do import { uuid } from 'mu/uuid.js'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant