[GitHub] [incubator-flagon-useralejs] poorejc opened a new issue #67: Refactor Gulp Build Pipeline

2021-03-18 Thread GitBox


poorejc opened a new issue #67:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/67


   Gulp is reaching obsolescence. Might consider webpack or new npm 
functionality as an alternative. 
   
   Opinion: webpack may be a better option given that relying on newer npm 
functionality will affect the projects compatability with earlier versions of 
npm (12x-14x), which many of our users still rely on.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc commented on issue #50: sendOnClose function broken -- logs dropped when users navigate away from page

2021-03-18 Thread GitBox


poorejc commented on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-802499142


   Removed sendOnRefresh from Submit event handling:
   
   ```
 Object.keys(refreshEvents).forEach(function(ev) {
   document.addEventListener(ev, function(e) {
 packageLog(e, events[ev]);
   }, true);
 });
   ```
   sendOnRefresh was triggering duplicate events. Given that Submit events 
trigger a refresh which switches the page into a 'hidden' visibility state, 
sendOnClose now correctly pushes submit chain of events (change, click, submit, 
load).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc commented on issue #50: sendOnClose function broken -- logs dropped when users navigate away from page

2021-03-18 Thread GitBox


poorejc commented on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-802497782


   Updated sendOnClose to flush logs queue:
   
   ```
   export function sendOnClose(logs, config) {
 document.addEventListener('visibilitychange', function () {
   if (document.visibilityState === 'hidden' && logs.length > 0) {
 navigator.sendBeacon(config.url, JSON.stringify(logs));
 logs.splice(0); // Clear array reference (no reassignment)
 }
   });
   ```
   resolves issue that any visibility change to 'hidden' state will send 
duplicate logs (e.g., switching tabs). This is desired behavior/intent for this 
function.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc edited a comment on issue #50: Last Log Drops from Log Queue when exiting page | specific configs

2021-03-18 Thread GitBox


poorejc edited a comment on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-801293796


   I have pushed the code that does work (commenting out the original code). 
However, it creates 2 other issues (at least):
   
   -breaks submit events. Submit events trigger a refresh. We use sendLogs 
(sendOnRefresh) to push those logs immediately when the event is detected. 
However, during the refresh cycle, the page enters into a hidden state. Result 
is we sometimes get duplicate logs (we're firing the logs off x2), but easy fix 
(remove sendOnRefresh) and keep testing.
   
   -breaks our logging server whenever page refreshes or navigate away or 
close--eg anytime sendOnClose would ship. Can see logs in ELK. Don't know why 
this happens.
   
   ```
   TypeError: req.body.forEach is not a function
   at 
/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/example/server.js:77:12
   at Layer.handle [as handle_request] 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/layer.js:95:5)
   at next 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/route.js:137:13)
   at Route.dispatch 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/layer.js:95:5)
   at 
/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/index.js:281:22
   at Function.process_params 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/index.js:335:12)
   at next 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/index.js:275:10)
   at jsonParser 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/body-parser/lib/types/json.js:119:7)
   at Layer.handle [as handle_request] 
(/Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/express/lib/router/layer.js:95:5)
   ```
   
   
   Also, breaks 2 unit tests (expected -- will eventually need be fixed):   
sendLogs
   ✓ sends logs on an interval
   ✓ does not send logs if the config is off
   1) sends logs on page exit with navigator
   2) sends logs on page exit without navigator
   ✓ does not send logs on page exit if config is off
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc removed a comment on issue #50: Last Log Drops from Log Queue when exiting page | specific configs

2021-03-18 Thread GitBox


poorejc removed a comment on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-801278588


   document.addEventListener('visibilitychange', function () {
 if (document.visibilityState === 'hidden' && logs.length > 0) {
   sendLogs(logs, config, 1);
 }
   });
   
   This code does not work. sendLogs doesn't seem to work when the page is in 
this state.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc edited a comment on issue #50: Last Log Drops from Log Queue when exiting page | specific configs

2021-03-18 Thread GitBox


poorejc edited a comment on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-801276755


   this code does work to the desired behavior:
   
   ```
   document.addEventListener('visibilitychange', function () {
   if (document.visibilityState === 'hidden' && logs.length > 0) {
 navigator.sendBeacon(config.url, JSON.stringify(logs));
   }
   }); 
   ```
   
   below is JSON snip from log firing from "linked button" element, which also 
opens a new page.
   
   "useraleVersion": "2.1.1",
   "toolName": "Apache UserALE.js Example (Custom)",
   "sessionID": "session_1616003276152",
   "type": "click",
   "path": [
 "button#Linked Button",
 "a",
 "body",
 "html",
 "#document",
 "Window"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc commented on pull request #61: adds cypress journey test

2021-03-18 Thread GitBox


poorejc commented on pull request #61:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/61#issuecomment-802448522


   Hi @UncleGedd sorry i've had my head in debugging. Did you add the custom 
label examples you built (re PR #64) on top of your commits for this PR (re PR 
#61)? Really what I'm asking is do I need to merge these separately, or should 
wait until we resolve last changes on #64 before merge to test?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




Re: [VOTE] New PPMC Candidate: Gedd Johnson (@UncleGedd)

2021-03-18 Thread Austin Bennett
+1 (non-binding, etc)

Though... should this be public/on-dev-list?

On Thu, Mar 18, 2021 at 6:00 PM Joshua Poore  wrote:

> +1 from me (Flagon PPMC)
>
> > On Mar 18, 2021, at 8:59 PM, Joshua Poore  wrote:
> >
> > Hello,
> >
> > I am calling a VOTE to add Gedd Johnson (@UncleGedd) to the Apache
> Flagon (Incubating) Podling Project Management Committee PPMC.
> >
> > Gedd originates from one of our key user groups and has an appreciation
> for our project in an application context.
> > Gedd’s interest in the project is authentic—working with Flagon is no
> longer part of his every day duties
> > He has already contributed a number of valuable features to UserALE.js
> > He is interested in contributing to the design, development, and
> maintenance of ongoing developments (e.g., Distill)
> > He has already shown a willingness to participate in the community and
> work collaboratively
> > He shows willingness and interest to address issues that are not-so-fun
> as well as more complex tasks
> > His PR’s have been easy to evaluate, he takes critical feedback well,
> and his code is elegant
> >
> > For these reasons and for his willingness to contribute to the project
> in a manner consistent with the Independent Contributor License Agreement
> (which he has reviewed), I am nominating Gedd as a member of the PPMC and
> as a committer for the ASF.
> >
> > The VOTE ends one week from today (2021-03-24)
> >
> > The RESULT will be carried over to the IPMC.
> >
> > See voting guidelines at https://community.apache.org/newcommitter.html
> 
> >
> > Thanks,
> >
> > Josh
>
>


Re: [VOTE] New PPMC Candidate: Gedd Johnson (@UncleGedd)

2021-03-18 Thread Joshua Poore
+1 from me (Flagon PPMC)

> On Mar 18, 2021, at 8:59 PM, Joshua Poore  wrote:
> 
> Hello,
> 
> I am calling a VOTE to add Gedd Johnson (@UncleGedd) to the Apache Flagon 
> (Incubating) Podling Project Management Committee PPMC.
> 
> Gedd originates from one of our key user groups and has an appreciation for 
> our project in an application context.
> Gedd’s interest in the project is authentic—working with Flagon is no longer 
> part of his every day duties
> He has already contributed a number of valuable features to UserALE.js
> He is interested in contributing to the design, development, and maintenance 
> of ongoing developments (e.g., Distill)
> He has already shown a willingness to participate in the community and work 
> collaboratively
> He shows willingness and interest to address issues that are not-so-fun as 
> well as more complex tasks
> His PR’s have been easy to evaluate, he takes critical feedback well, and his 
> code is elegant
> 
> For these reasons and for his willingness to contribute to the project in a 
> manner consistent with the Independent Contributor License Agreement (which 
> he has reviewed), I am nominating Gedd as a member of the PPMC and as a 
> committer for the ASF.
> 
> The VOTE ends one week from today (2021-03-24)
> 
> The RESULT will be carried over to the IPMC.
> 
> See voting guidelines at https://community.apache.org/newcommitter.html 
> 
> 
> Thanks,
> 
> Josh



[VOTE] New PPMC Candidate: Gedd Johnson (@UncleGedd)

2021-03-18 Thread Joshua Poore
Hello,

I am calling a VOTE to add Gedd Johnson (@UncleGedd) to the Apache Flagon 
(Incubating) Podling Project Management Committee PPMC.

Gedd originates from one of our key user groups and has an appreciation for our 
project in an application context.
Gedd’s interest in the project is authentic—working with Flagon is no longer 
part of his every day duties
He has already contributed a number of valuable features to UserALE.js
He is interested in contributing to the design, development, and maintenance of 
ongoing developments (e.g., Distill)
He has already shown a willingness to participate in the community and work 
collaboratively
He shows willingness and interest to address issues that are not-so-fun as well 
as more complex tasks
His PR’s have been easy to evaluate, he takes critical feedback well, and his 
code is elegant

For these reasons and for his willingness to contribute to the project in a 
manner consistent with the Independent Contributor License Agreement (which he 
has reviewed), I am nominating Gedd as a member of the PPMC and as a committer 
for the ASF.

The VOTE ends one week from today (2021-03-24)

The RESULT will be carried over to the IPMC.

See voting guidelines at https://community.apache.org/newcommitter.html 


Thanks,

Josh

[GitHub] [incubator-flagon-useralejs] confusingstraw commented on pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#issuecomment-802304482


   > Gotcha, thanks for the thorough explanation! Understood that the Userale 
map/filter functions operate on the logging pipeline and they operate just like 
their JS array API counterparts. In the example code above, what is the purpose 
of adding the event listener? (noting that the snippet was originally taken 
from 
[examples/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js))
   
   as @poorejc mentioned, it is probably just an artifact of quickly writing 
examples. the only examples i'm familiar with are the first two on the main 
`README.md` examples section. it is my fault for not having made a larger body 
of examples to pull from, as the `map`/`filter`/`packageCustomLog` API should 
be flexible enough to handle the vast majority of use cases, and it should be 
possible to do so without writing hacks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc commented on pull request #64: Custom labels docs

2021-03-18 Thread GitBox


poorejc commented on pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#issuecomment-802284221


   I built those examples just to demonstrate some simple custom logging 
behavior for .log, .packageLog, .packageCustomLog exports. Also wanted some 
simple examples for how UserAle performed against form data, which wasn’t 
previously well supported. Two birds with one stone.
   
   But, yes you’re not crazy—those event handlers are duplicative of out of the 
box UserAle event capture. Just super simple examples that are easy to 
understand in a very simple webpage. Clearly, maybe not as simple as I hoped ;)
   
   Joshua Poore
   
   
   > On Mar 18, 2021, at 4:18 PM, UncleGedd ***@***.***> wrote:
   > 
   > 
   > Gotcha, thanks for the thorough explanation! Understood that the Userale 
map/filter functions operate on the logging pipeline and they operate just like 
their JS array API counterparts. In the example code above, what is the purpose 
of adding the event listener?
   > 
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub, or unsubscribe.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd edited a comment on pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd edited a comment on pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#issuecomment-802260129


   Gotcha, thanks for the thorough explanation! Understood that the Userale 
map/filter functions operate on the logging pipeline and they operate just like 
their JS array API counterparts. In the example code above, what is the purpose 
of adding the event listener? (noting that the snippet was originally taken 
from 
[examples/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js))


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd commented on pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#issuecomment-802260129


   Gotcha, thanks for the thorough explanation! Understood that the Userale 
map/filter functions operate on the logging pipeline and they operate just like 
their JS array API counterparts. In the example code above, what is the purpose 
of adding the event listener?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597162520



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   the key takeaway is that `userale.map` and `userale.filter` are intended 
to function in a similar way to [Array.map 
](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
 )and 
[Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
 that is, they operate on all the logs moving through the `userale` pipeline.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597198545



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   Agreed Rob, I also prefer the idea of just using the `userale.map` 
function as opposed to adding more event listeners. I think we need a bit more 
context on what exactly the users are trying to accomplish and what they want 
to [decorate](https://github.com/apache/incubator-flagon-useralejs/issues/63).
   
   The examples that Rob linked are located at 
[example/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js).
 Do you have any idea why in that code the extra event listeners are added?
   
EDIT: I saw the examples you mentioned over in the README but I'm not quite 
understanding their usage. Is the goal just to subvert the Userale logs and 
event handlers?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597198545



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   Agreed Rob, I also prefer the idea of just using the `userale.map` 
function as opposed to adding more event listeners. I think we need a bit more 
context on what exactly the users are trying to accomplish and what they want 
to [decorate](https://github.com/apache/incubator-flagon-useralejs/issues/63).
   
   The examples that Rob linked are located at 
[example/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js).
 Do you have any idea why in that code the extra event listeners are added?
   
EDIT: I saw the examples you mentioned over in the README but I'm not quite 
understanding their usage. Is the goal just to subvert the Userale logs and 
handlers?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597198545



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   Agreed Rob, I also prefer the idea of just using the `userale.map` 
function as opposed to adding more event listeners. I think we need a bit more 
context on what exactly the users are trying to accomplish and what they want 
to [decorate](https://github.com/apache/incubator-flagon-useralejs/issues/63).
   
   The examples that Rob linked are located at 
[example/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js).
 Do you have any idea why in that code the extra event listeners are added?
   





-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597198545



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   Agreed Rob, I also prefer the idea of just using the `userale.map` 
function as opposed to adding more event listeners. I think we need a bit more 
context on what exactly the users are trying to accomplish and what they want 
to [decorate](https://github.com/apache/incubator-flagon-useralejs/issues/63).
   
   The examples that Rob linked and are located at 
[example/index.js](https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js).
 Do you have any idea why in that code the extra event listeners are added?
   





-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597154184



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   if you want to make the code extra compact (not something i am a huge 
fan of), you can write it like this:
   ```js
   window.userale.map((log, e) => e.type ==='click' && e.target.innerHTML === 
'New Feature'
   ? { ...log, customLabel: 'New Feature', logType: 'custom' }
   : log);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597152859



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   this works, but i think it relies a bit on the implementation details of 
`map`/`packageLog`. the intended usage is captured in the (non-highlighted) 
example in the main `README.md`.
   
   when we call the `userale.map` function, it keeps the function you pass it 
around until it gets re-assigned. the given function gets called for _every_ 
log that the library receives. with that in mind, there is no need to setup 
your own event listener, as that is what userale is for. note that using it 
this way _won't_ produce duplicate logs.
   
   here is how i'd imagine the above code would be implemented:
   ```js
   // no need to set up a separate listener
   window.userale.map((log, e) => {
   // determine whether we want to modify the log
   if (e.type !=='click' || e.target.innerHTML !== 'New Feature') {
   return log; // return the log if we don't care about this event
   }
   
   // return the log with any changes we want
   return {
   ...log,
   customLabel: 'New Feature',
   logType: 'custom',
   };
   });
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597152859



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   this works, but i think it relies a bit on the implementation details of 
`map`/`packageLog`. the intended usage is captured in the (non-highlighted) 
example in the main `README.md`.
   
   when we call the `userale.map` function, it keeps the function you pass it 
around until it gets re-assigned. the given function gets called for _every_ 
log that the library receives. with that in mind, there is no need to setup 
your own event listener, as that is what userale is for. note that using it 
this way _won't_ produce duplicate logs.
   
   here is how i'd imagine the above code would be implemented:
   ```js
   // no need to set up a separate listener
   window.userale.map((log, e) => {
   // determine whether we want to modify the log
   if (e.target.innerHTML !== 'New Feature') {
   return log; // return the log if we don't care about this event
   }
   
   // return the log with any changes we want
   return {
   ...log,
   customLabel: 'New Feature',
   logType: 'custom',
   };
   });
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597154184



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   if you want to make the code extra compact (not something i am a huge 
fan of), you can write it like this:
   ```js
   window.userale.map((log, e) => e.target.innerHTML === 'New Feature'
   ? { ...log, customLabel: 'New Feature', logType: 'custom' }
   : log);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] confusingstraw commented on a change in pull request #64: Custom labels docs

2021-03-18 Thread GitBox


confusingstraw commented on a change in pull request #64:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/64#discussion_r597152859



##
File path: example/log-label-example/README.md
##
@@ -0,0 +1,97 @@
+# Custom Log Label Examples
+
+Examples illustrating how to add custom labels to logs generated by `userale`.
+
+## Adding Custom Labels to Logs
+
+### Method 1
+
+Consider the following HTML:
+
+```html
+
+
+New Feature
+
+```
+
+The following code snippet will add a custom field and send a log whenever the 
new feature button is clicked:
+
+```js
+document.addEventListener('click', function (e) {
+if (e.target.innerHTML === 'New Feature') {
+window.userale.map(log => ({...log, logType: 'custom', customLabel: 
'New Feature'}));
+window.userale.packageLog(e, 
window.userale.details(window.userale.options(), e.type));
+window.userale.map();
+} else {
+return false
+}
+});

Review comment:
   this works, but i think it relies a bit on the implementation details of 
`map`/`packageLog`. the intended usage is captured in the (non-highlighted) 
example in the main `README.md`.
   
   when we call the `userale.map` function, it keeps the function you pass it 
around until it gets re-assigned. the given function gets called for _every_ 
log that the library receives. with that in mind, there is no need to setup 
your own event listener, as that is what userale is for. all you need to 
   
   here is how i'd imagine the above code would be implemented:
   ```js
   // no need to set up a separate listener
   window.userale.map((log, e) => {
   // determine whether we want to modify the log
   if (e.target.innerHTML !== 'New Feature') {
   return log; // return the log if we don't care about this event
   }
   
   // return the log with any changes we want
   return {
   ...log,
   customLabel: 'New Feature',
   logType: 'custom',
   };
   });
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] poorejc commented on issue #50: Last Log Drops from Log Queue when exiting page | specific configs

2021-03-18 Thread GitBox


poorejc commented on issue #50:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/50#issuecomment-802165728


   @UncleGedd This issues is a veritable existence proof for Journey Testing... 
Unit tests were deceptive given methods they used for mocking DOM. Resulted in 
lost data.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd edited a comment on issue #63: Decorator Syntax Examples

2021-03-18 Thread GitBox


UncleGedd edited a comment on issue #63:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-802055731


   [PR](https://github.com/apache/incubator-flagon-useralejs/pull/64) that 
expands on the examples above


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd commented on issue #63: Decorator Syntax Examples

2021-03-18 Thread GitBox


UncleGedd commented on issue #63:
URL: 
https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-802055731


   Linked [PR](https://github.com/apache/incubator-flagon-useralejs/pull/64) 
that expands on the examples above


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-flagon-useralejs] UncleGedd opened a new pull request #64: Custom labels docs

2021-03-18 Thread GitBox


UncleGedd opened a new pull request #64:
URL: https://github.com/apache/incubator-flagon-useralejs/pull/64


   ### Decorator Syntax Examples
   - Adds documentation and working example around the functions mentioned in 
the comments of this 
[issue](https://github.com/apache/incubator-flagon-useralejs/issues/63)
   - IMO the second method is simpler than than the first, would like to get 
some user feedback to see if this is adds value with respect to custom label 
implementation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org