Skip to content

Localhost module and validator for slim entry point - #55

Merged
EmilianoSanchez merged 11 commits into
pluggable_storage_baselinefrom
localhost_module_for_slim_entrypoint
Oct 14, 2021
Merged

Localhost module and validator for slim entry point#55
EmilianoSanchez merged 11 commits into
pluggable_storage_baselinefrom
localhost_module_for_slim_entrypoint

Conversation

@EmilianoSanchez

@EmilianoSanchez EmilianoSanchez commented Oct 7, 2021

Copy link
Copy Markdown
Contributor

Javascript commons library

What did you accomplish?

  • Added localhost factory modules and validator for the slim entry point of JS Browser and RN

How do we test the changes introduced in this PR?

Extra Notes

Comment thread src/logger/messages/error.ts Outdated
[c.ERROR_EMPTY_ARRAY, '%s: %s must be a non-empty array.'],
// initialization / settings validation
[c.ERROR_INVALID_IMPRESSIONS_MODE, c.LOG_PREFIX_SETTINGS + ': you passed an invalid "impressionsMode". It should be one of the following values: %s. Defaulting to "%s" mode.'],
[c.ERROR_LOCALHOST_MODULE_REQUIRED, c.LOG_PREFIX_SETTINGS + ': you didn\'t pass a valid "sync.localhostMode". It should be defined for using the SDK in localhost mode']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

": an invalid value was received for "sync.localhostMode" config. A valid entity should be provided for localhost mode."

Comment thread src/sync/syncManagerFromFile.ts Outdated
@@ -0,0 +1,13 @@
import { splitsParserFromFileFactory } from './offline/splitsParser/splitsParserFromFile';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving these to src/sync/offline

Comment thread src/sync/syncManagerFromObject.ts Outdated
@@ -0,0 +1,12 @@
import { splitsParserFromSettingsFactory } from './offline/splitsParser/splitsParserFromSettings';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

export function validateLocalhost(settings: ISettings) {
const localhostMode = settings.sync.localhostMode;

if (settings.mode === LOCALHOST_MODE && (typeof localhostMode !== 'function' || localhostMode.type !== LOCALHOST_MODE)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this validation by "Type", let's add a comment to revisit the values it can have at some point, or maybe changing the property name.

Base automatically changed from localhost_with_ready_from_cache to pluggable_storage_baseline October 14, 2021 13:56
@EmilianoSanchez
EmilianoSanchez merged commit 5717c08 into pluggable_storage_baseline Oct 14, 2021
@EmilianoSanchez
EmilianoSanchez deleted the localhost_module_for_slim_entrypoint branch October 14, 2021 20:21
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.

2 participants