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

prepare 3.0.0 release #4

Merged
merged 50 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ad35601
initial move of code from js-client-sdk-private
eli-darkly Oct 30, 2019
abd39cd
changelog note
eli-darkly Oct 30, 2019
d64ad13
rm obsolete comment
eli-darkly Oct 30, 2019
05fa2ea
add npm audit helper
eli-darkly Oct 30, 2019
722b6f4
update babel, jest, rollup
eli-darkly Oct 30, 2019
83156f4
fix rollup config
eli-darkly Oct 30, 2019
c062853
fix ES build, dependency cleanup
eli-darkly Oct 30, 2019
5c0e2ac
add Releaser metadata
eli-darkly Oct 30, 2019
2a16af0
Update babel config to work in `test` without `useBuiltIns`
zmdavis Oct 30, 2019
e333469
Merge pull request #1 from launchdarkly/eb/update-dev-tools
eli-darkly Oct 31, 2019
f09a83a
Merge pull request #3 from launchdarkly/zdavis/babel-config
eli-darkly Oct 31, 2019
55c3852
copyedits
eli-darkly Oct 31, 2019
d361672
fix misnamed directory
eli-darkly Nov 1, 2019
f4eb20a
Merge pull request #2 from launchdarkly/eb/ch48393/initial
eli-darkly Nov 4, 2019
f072529
use spread operator instead of Object.assign
eli-darkly Nov 4, 2019
7c1299e
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
957f477
Merge pull request #4 from launchdarkly/eb/ch54985/object-assign
eli-darkly Nov 4, 2019
a57c404
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
1539659
add issue templates
eli-darkly Nov 4, 2019
013c273
add babel-eslint
eli-darkly Nov 4, 2019
db12eca
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
087773b
merge from public after release
LaunchDarklyCI Nov 4, 2019
5bac01d
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Nov 7, 2019
e145270
add event capacity config property
eli-darkly Dec 3, 2019
34ed8a5
re-add deprecation warning on samplingInterval
eli-darkly Dec 3, 2019
2ef59bc
Merge pull request #5 from launchdarkly/eb/ch57883/event-capacity
eli-darkly Dec 3, 2019
33d0311
Merge pull request #6 from launchdarkly/eb/ch38635/deprecation-comment
eli-darkly Dec 3, 2019
3c3e22a
better config validation
eli-darkly Dec 3, 2019
5cfb5a0
remove rollup-plugins-node-resolve
eli-darkly Dec 4, 2019
3c0794a
use newer Rollup node-resolve plugin
eli-darkly Dec 4, 2019
6385bb7
rm rollup-plugin-includepaths (unused)
eli-darkly Dec 4, 2019
c1b6f09
npm audit fix (handlebars dependency from jest)
eli-darkly Dec 4, 2019
11e46e1
comment
eli-darkly Dec 4, 2019
7cc15ba
copyedit
eli-darkly Dec 4, 2019
c44052b
Merge pull request #7 from launchdarkly/eb/ch57985/config-validation
eli-darkly Dec 4, 2019
9dbb6b2
Merge pull request #8 from launchdarkly/eb/ch57982/rollup-builtins
eli-darkly Dec 4, 2019
1cf982b
use new test helpers + misc test cleanup
eli-darkly Dec 5, 2019
9077edf
clean up stream testing logic
eli-darkly Dec 6, 2019
3f77514
fix hash parameter
eli-darkly Dec 6, 2019
d1fe985
Merge pull request #9 from launchdarkly/eb/ch57131/test-cleanup
eli-darkly Dec 7, 2019
d0de600
linter
eli-darkly Dec 7, 2019
b0168db
Merge pull request #10 from launchdarkly/eb/ch57131/stream-tests
eli-darkly Dec 7, 2019
b489fb2
clearer way to model the config option defaults/types
eli-darkly Dec 9, 2019
a32383c
test improvements
eli-darkly Dec 9, 2019
cdc1e96
change internal param name
eli-darkly Dec 9, 2019
2fcfa79
comment
eli-darkly Dec 9, 2019
88aa416
fix default logger logic
eli-darkly Dec 9, 2019
ceb9e3d
simpler way to enforce minimum values
eli-darkly Dec 10, 2019
58ee382
Merge pull request #12 from launchdarkly/eb/ch57985/config-validation…
eli-darkly Dec 10, 2019
0a782ca
add support for function type in config options (#13)
eli-darkly Dec 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
976 changes: 59 additions & 917 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@babel/plugin-transform-runtime": "7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/runtime": "7.6.3",
"@rollup/plugin-node-resolve": "^6.0.0",
"@rollup/plugin-replace": "^2.2.0",
"babel-eslint": "10.0.3",
"babel-jest": "^24.9.0",
Expand All @@ -55,21 +56,18 @@
"eslint-plugin-prettier": "2.6.0",
"jest": "^24.9.0",
"jsdom": "^11.11.0",
"launchdarkly-js-test-helpers": "1.1.0",
"prettier": "1.11.1",
"readline-sync": "1.4.9",
"rimraf": "2.6.2",
"rollup": "^1.26.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^6.2.1",
"rollup-plugin-includepaths": "^0.2.3",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-uglify": "^6.0.3",
"semver": "5.5.0",
"semver-compare": "1.0.0",
"sinon": "7.2.7",
"typescript": "3.0.1"
},
"dependencies": {
Expand Down
4 changes: 1 addition & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const pkg = require('./package.json');
const resolve = require('rollup-plugin-node-resolve');
const resolve = require('@rollup/plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const babel = require('rollup-plugin-babel');
const replace = require('@rollup/plugin-replace');
const { terser } = require('rollup-plugin-terser');
const { uglify } = require('rollup-plugin-uglify');
const builtins = require('rollup-plugin-node-builtins');
const filesize = require('rollup-plugin-filesize');

const env = process.env.NODE_ENV || 'development';
Expand All @@ -18,7 +17,6 @@ const basePlugins = [
'process.env.NODE_ENV': JSON.stringify(env),
VERSION: JSON.stringify(version),
}),
builtins(),
resolve({
mainFields: ['browser', 'module', 'main'],
preferBuiltins: true,
Expand Down
18 changes: 16 additions & 2 deletions src/EventProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export default function EventProcessor(platform, options, environmentId, emitter
const userFilter = UserFilter(options);
const inlineUsers = options.inlineUsersInEvents;
const samplingInterval = options.samplingInterval;
const eventCapacity = options.eventCapacity;
const flushInterval = options.flushInterval;
const logger = options.logger;
let queue = [];
let lastKnownPastTime = 0;
let disabled = false;
let exceededCapacity = false;
let flushTimer;

function shouldSampleEvent() {
Expand Down Expand Up @@ -51,6 +53,18 @@ export default function EventProcessor(platform, options, environmentId, emitter
return ret;
}

function addToOutbox(event) {
if (queue.length < eventCapacity) {
queue.push(event);
exceededCapacity = false;
} else {
if (!exceededCapacity) {
exceededCapacity = true;
logger.warn(messages.eventCapacityExceeded());
}
}
}

processor.enqueue = function(event) {
if (disabled) {
return;
Expand All @@ -73,14 +87,14 @@ export default function EventProcessor(platform, options, environmentId, emitter
}

if (addFullEvent) {
queue.push(makeOutputEvent(event));
addToOutbox(makeOutputEvent(event));
}
if (addDebugEvent) {
const debugEvent = utils.extend({}, event, { kind: 'debug' });
delete debugEvent['trackEvents'];
delete debugEvent['debugEventsUntilDate'];
delete debugEvent['variation'];
queue.push(debugEvent);
addToOutbox(debugEvent);
}
};

Expand Down
Loading