[Umbrella] Updating & Fixing Types
See original GitHub issue☔️ Overview
Doing a clean up round on types, using this issue to track the PR’s associated to it.Will be editing this post as I progress. Comments/Recommendations are appreciated.
First Round
First Round will be small isolated PR’s, that way no conflicting discussions or delays in certain scope effects the initiation of Second Round Changes.
-
jest-config (getMaxWorkers) #8434
- Missing type string when getMaxWorkers allows a string
-
jest-validate (condition)- multipleValidOptions #8435
- should infer the types of its arguments, and return a union type of the types
-
jest-config (utils) #8437
- Improve/Fix typing’s
potentially merge_replaceRootDirInObjectwithin_replaceRootDirTags
-
jest-config(normalize)Improve typing’s of main normalize function and helpers (not changing code eval)
-
jest-types
- Use interfaces where makes sense in-order to merge/extends easier
- Maybe: Add a separate interface for “deprecated options” that are still supported
-
jest-enviroment #8439
- Add types to ModuleWrapper
- Update usage in jest-runtime
-
General Maintenance #8462
- Remove/Fix unnecessary castings
- make all general Object Types consistent throughout the codebase, using Record.
Second Round
Second Round will begin after key PRs(dependable) from first round are committed.
-
jest-config(normalize) - Improve typing’s and structureCurrent structure of the normalize function is not type-safe and can be optimized.( hold off in favor of #7185 )
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Prerequisites - Cisco Umbrella Documentation
To ensure that the Cisco Umbrella roaming client deploys and runs successfully, Umbrella requires that you meet the following prerequisites.
Read more >How To Fix The SSH Key Vulnerability In Cisco Umbrella ...
Upgrading Cisco Umbrella to v3.3.2 is the recommended approach to fix the SSH Key vulnerability in Cisco Umbrella Virtual Appliance. Let's see how...
Read more >thi-ng/umbrella: Broadly scoped ecosystem & mono ... - GitHub
Immutable data handling, state containers, transacted state updates, Undo-Redo history; Data driven UI component toolkits (DOM-based, canvas-based, immediate- ...
Read more >Cisco ASA Series Firewall CLI Configuration Guide, 9.13 ...
This allows Cisco Umbrella to identify requests to black- or grey-list domain names and apply your DNS-based security policy.
Read more >Neewer® 2 Pieces S-Type Bracket Holder with Bowens Mount ...
Amazon.com : Neewer® 2 Pieces S-Type Bracket Holder with Bowens Mount for Speedlite Flash Snoot Softbox Beauty Dish Reflector Umbrella : Electronics.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@jeysal , that makes sense. and in that case i will hold off on any dramatic changes on normalize. On a related note,I was trying to think of a way to re-format jest-types Config, and this may also be helpful when restructuring the way the configs are handled. With the current state of Config types, i was trying to think of a way to break down the types and reuse them throughout the main exports
InitialOptions,DefaultOptions,GlobalConfigProjectConfigArgv. Rather than the current setup of having all properties repeatedly typed. So I began with partitioning the overlaps ofGlobalConfigProjectConfigArgv, and treated the properties as a pipe line from argv. and came up with something like this: *“Shared” refers to ProjectConfig & GlobalConfig Looking atProjectConfigFirst, what properties types onArgv, are identical to the requiredProjectConfig, (will call this Direct)⬇️ Next what are the properties that share the same key but undlerying types are different. ( will break this down into 2 Raw & derivedfromArgv.
⬇️ Next the remaining ProjectOptions that are derived elsewhere or in combination of other options, (will call this ProjectOptionsDerived)
Now do the same for GlobalConfig
Then again for options that are shared b/n global and project
Now defining the remaining argv config that doesnt get passed on
Then the final resulting types:
Breaking them down may also be helpful with functional transformers:
And you will also be able to write option api description once and keep intelli throughout.
lmk your thoughts… i’ll tinker around a bit. (btw sorry for the long tangent)
@JoshRosenstein My preference would be to validate user-provided config using
io-ts. Then, once we’ve ensured that the objects we’re operating on actually match our static types exactly, we should generate the internal config format in a way that typechecks well (e.g. avoiding mutation in favour of a more functional style usually helps with this). To be clear, I still see the need to treat user config and internal config separately. One reason for this is that internal config usually has goals like not being redundant (e.g. you shouldn’t need to both check forundefinedand''on the config unless there’s a semantic difference), while user config might not care about this and offer alternatives (e.g. shortening an array containing a single string to just a string) - these are just examples. Simplifying configuration is scheduled for v25, yes. I expect normalize to be mostly rewritten in the process (kind of scared how this will play with not reworking CLI options at the same time though), so I think the easiest way of going about it would be to just ensure that the new code is TSC-friendly.