Open Gabswim opened 1 week ago
This is related to TS case, right?
1) The issue can be fixed, but it will also add ~50Kb to dts libdefs.
2) If we'd like to replace the current YAML engine with another one (smaller, faster, etc), no chance that it will also provide support for parseDocument/parseAllDocuments
CC @antonmedv
This is because we bundle yaml?
Because we've omitted the API typings except parse
and stringify
.
But the parseAllDocuments code is still in the bundle?
I have a workaround: installing the yaml
library directly if the goal is to restrain the API to a smaller footprint.
But the parseAllDocuments code is still in the bundle?
Yes, so right now the typing is not showing the reality of what is being accessible. Maybe what you can do is something like this
import { parse, stringify } from 'yaml'
export const YAML = {
parse,
stringify
}
But the parseAllDocuments code is still in the bundle?
Correct. In js bundle.
But why ts def grows so much?
External contracts are derived from internal ones. There are actually many many types. https://www.npmjs.com/package/yaml?activeTab=code
Expected Behavior
https://stackblitz.com/edit/zx7-2-3-yaml?file=src/main.ts&terminal=dev
Actual Behavior
https://stackblitz.com/edit/zx-8-1-3-yaml?file=src/main.ts&terminal=dev
Steps to Reproduce
7.2.3
to8.1.3
.Specifications