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

update src/core/index.js to export all global APIs, deprecate old globals… #1195

Conversation

trusktr
Copy link
Member

@trusktr trusktr commented May 23, 2020

...in favor of a single global DOCSIFY, and add tests for this

@anikethsaha This updates #1192 to fix the issues I found there.

The build now works, and the change is backwards compatible: it leaves the old globals in place but additionally creates a new single global variable DOCSIFY that we should recommend in favor of the other multiple globals which we should deprecate in the docs.

I don't think this needs to be in a major version bump as people can still use the old globals, unaffected (as per the new tests in this PR). Then in the next major we can remove the old global. Plus we can add an .esm.js bundle and recommend for people to use that instead of the global version so that they don't pollute the global space.

This new DOCSIFY global has the Docsify constructor exposed, so we can start heading in a direction where we prefer people to do new DOCSIFY.Docsify(options) instead of window.$docsify = options. In a following PR, I can add the new behavior but keep the old $docsify options working for backwards compatibility without having to save it for a major bump.

@trusktr trusktr requested a review from a team May 23, 2020 21:04
@vercel
Copy link

vercel bot commented May 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/hsx5hz7n8
✅ Preview: https://docsify-previe-git-deprecate-old-globals-and-make-new-si-32a16c.docsify-core.now.sh

@trusktr
Copy link
Member Author

trusktr commented May 23, 2020

Semantic Pull Request — add a semantic commit or PR title

Ah, nice check! Let me fix that!

…ld globals in favor of a single global DOCSIFY, and add tests for this
@trusktr trusktr force-pushed the deprecate-old-globals-and-make-new-single-global branch from fb17fe6 to 7e002bf Compare May 23, 2020 21:12
@trusktr trusktr merged commit b40baae into add-build-error-handling May 23, 2020
@trusktr trusktr deleted the deprecate-old-globals-and-make-new-single-global branch May 23, 2020 21:21
@anikethsaha
Copy link
Member

@trusktr can you submit a PR with updated docs where-ever needed.

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