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

fix(io/buffer): make Buffer compatible with Deploy #912

Merged
merged 3 commits into from
May 14, 2021

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented May 11, 2021

This PR fixes type error of io/buffer in Deploy environment by inlining Reader / ReaderSync interafaces.

This enables deploy script using, for example, encoding/yaml module without type error with deployctl run. https://gist.github.com/kt3k/43e25efffc6e1c360fc64274ea0381eb

closes #907

io/buffer.ts Outdated
@@ -1,6 +1,14 @@
import { assert } from "../_util/assert.ts";
import { copy } from "../bytes/mod.ts";

interface Reader {
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to have a io/types.d.ts and put the Reader*/Writer*, etc and then import type from there? It would solve part of denoland/deno#9795. I wouldn't necessarily refactor all of io to use them at the moment, but it would be better than just burying them in buffer.ts while all of io and other std modules should move over to these.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would make more sense and sounds natural. Updated.

Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

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

LGTM

@kt3k kt3k merged commit b20aee7 into denoland:main May 14, 2021
@kt3k kt3k deleted the fix/yaml-compat-deploy branch May 14, 2021 00:26
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.

Make encoding/yaml.ts type-compatible with Deno Deploy
2 participants