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

Drop 'yaml/parse-cst' endpoint #223

Merged
merged 2 commits into from Jan 30, 2021
Merged

Drop 'yaml/parse-cst' endpoint #223

merged 2 commits into from Jan 30, 2021

Conversation

eemeli
Copy link
Owner

@eemeli eemeli commented Jan 29, 2021

BREAKING CHANGE

Users will need to update their code:

-import parseCST from 'yaml/parse-cst'
+import YAML from 'yaml'
+const parseCST = YAML.parseCST

This simplifies the public API of the library, but should not adversely affect users. Providing a separate endpoint has previously made it simpler for browser bundlers to treeshake the library for users that only use the CST parser, but the updated exports should now allow for that to happen even with a single export. Especially once #208 is resolved, as it should now be possible to provide ES-only exports for browsers.

This is also related to #203, which will change the output & API of YAML.parseCST rather thoroughly.

BREAKING CHANGE: Users will need to update their code:
    -import parseCST from 'yaml/parse-cst'
    +import YAML from 'yaml'
    +const parseCST = YAML.parseCST
@eemeli eemeli merged commit f58f351 into master Jan 30, 2021
@eemeli eemeli deleted the drop-parse-cst branch January 30, 2021 10:40
@ssbarnea
Copy link

@eemeli While I see this as part of v2 release notes, there is nothing named parseCST in the current main branch and I see not PR referring this one. Any hints?

@eemeli
Copy link
Owner Author

eemeli commented Apr 14, 2022

The new API for that is provided by the Parser class, documented here: https://eemeli.org/yaml/#parser

Note that the v2 CST is rather different from the v1 CST.

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.

None yet

2 participants