Extract uuid to a separate file #72
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'