Closed 7rulnik closed 7 years ago
Merging #56 into master will decrease coverage by
0.65%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
- Coverage 71.13% 70.47% -0.66%
==========================================
Files 6 6
Lines 97 105 +8
Branches 20 21 +1
==========================================
+ Hits 69 74 +5
Misses 28 28
- Partials 0 3 +3
Impacted Files | Coverage Ξ | |
---|---|---|
src/handler.js | 72.5% <100%> (-0.48%) |
:arrow_down: |
src/utils.js | 90.9% <100%> (+2.67%) |
:arrow_up: |
src/index.js | 0% <0%> (-7.7%) |
:arrow_down: |
src/db.js | 77.77% <0%> (-5.56%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update 2add293...8439008. Read the comment docs.
But I think that opportunity to pass something more complicated than strings will be cool. How we should pass arrays or objects?
I am kind of thorn between this would be nice to have and it is a good thing to have the restriction.
What do you think @mxstbr? We can add it later under another param name e.g. meta_json
.
If we want to support more complex data structures I think urlencoded json is a good way to go.
Honestly I don't think that ?meta=k1:v1,k2:v2
is a good way for passing additional data.
?meta=k1:v1,k2:v2
. It's not really hard, but it can be easier.I think that POST is correct way for passing meta.
fetch('/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
meta: {β¦},
})
})
And JSON.parse
on server.
I prefer to decide how it will be before shipping something for users.
I agree, I am thinking that it would be great if we turned it so that get only reads and post is the way to put things into the db.
If we split get and put it would be major release, so for now we can merge this PR and release it as minor version. After this I can start splitting.
it would be great if we turned it so that get only reads
I'm not a fan of that, I quite like that GET
also increments because it supports this pattern: (which is what I built micro-analytics
for initially)
window.onload = () => {
fetch(`my-analytics.com/${window.location.href}`)
.then(data => console.log(`${data.views} views`))
}
I do agree that ?meta
isn't the best choice though, we could just do POST
to add meta data but GET
still increments?
I do agree that ?meta isn't the best choice though, we could just do POST to add meta data but
GET
still increments?
π
Closing this as we want to revisit without meta in GET requests. The meta-branch contains a wip version of that on top of the lerna restructure.
@relekang @mxstbr It should resolve https://github.com/micro-analytics/micro-analytics-cli/issues/24
But I think that opportunity to pass something more complicated than strings will be cool. How we should pass arrays or objects?