-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[kbn/io-ts] export and require importing individual functions #117958
Conversation
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/apm-ui (Team:apm) |
Pinging @elastic/uptime (Team:uptime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uptime code owner changes LGTM !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @spalger, much better! Is this process scriptable?
Conflict between elastic#117958 and elastic#115145 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
…117958) (#118074) * [kbn/io-ts] export and require importing individual functions (#117958) * [kbn/io-ts] fix direct import Conflict between #117958 and #115145 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Spencer <email@spalger.com> Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
I'm trying to make it "against the rules" to import from
target_node
and other directories created by Bazel, and saw how we prevent importing all the code from@kbn/io-ts-utils
in the browser bundles I figured we should upgrade the way we do this a bit by setting up some importable targets in the@kbn/io-ts-utils
package. There is now one import target for each module/function in io-ts:@kbn/io-ts-utils/deep_exact_rt
@kbn/io-ts-utils/iso_to_epoch_rt
@kbn/io-ts-utils/json_rt
@kbn/io-ts-utils/merge_rt
@kbn/io-ts-utils/non_empty_string_rt
@kbn/io-ts-utils/parseable_types
@kbn/io-ts-utils/props_to_schema
@kbn/io-ts-utils/strict_keys_rt
@kbn/io-ts-utils/to_boolean_rt
@kbn/io-ts-utils/to_json_schema
@kbn/io-ts-utils/to_number_rt
In addition to these import targets and updates to everything importing from
@kbn/io-ts-utils
, this adds an ESLint rule that prevents importing from the root of the@kbn/io-ts-utils
package and encourages used of the other modules instead. I implemented this across both theserver
andpublic
code for consistency but I'd be happy to limit this eslint rule to just thepublic
andcommon
code.