update src/core/index.js to export all global APIs, deprecate old globals…#1195
Merged
trusktr merged 1 commit intoadd-build-error-handlingfrom May 23, 2020
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/hsx5hz7n8 |
Member
Author
Ah, nice check! Let me fix that! |
…ld globals in favor of a single global DOCSIFY, and add tests for this
fb17fe6 to
7e002bf
Compare
Member
|
@trusktr can you submit a PR with updated docs where-ever needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...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
DOCSIFYthat 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.jsbundle and recommend for people to use that instead of the global version so that they don't pollute the global space.This new
DOCSIFYglobal has theDocsifyconstructor exposed, so we can start heading in a direction where we prefer people to donew DOCSIFY.Docsify(options)instead ofwindow.$docsify = options. In a following PR, I can add the new behavior but keep the old$docsifyoptions working for backwards compatibility without having to save it for a major bump.