-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
conversion to ESM, and deletion of CommonJS #2106
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@sy-records EDIT: I needed to hit "Redploy" without build cache. Now past that error. |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit eb3706c:
|
Just saw your comment, but I fixed already. :) It will be nice if we can see builds for all pull requests, because right now the base of this pull request is |
Ok, I updated test.yml, and now all builds are running! Nice! |
We should add a few more tests that currently do not exists while we're at it, to test for backwards compatibilty. For example:
Basically we want to ensure that all people using the standard |
Tests are almost passing. Darn Windows! Once we're ready, I'll squash with angular commit format. |
The build is green! |
EDIT: nevermind. Looks like it already doesn't work from before. For example, this build, https://docsify-preview-6nln8n898-docsifyjs.vercel.app/#/configuration?id=vuemounts for pull request #2093 doesn't work. |
I pushed one more update to restore deleted example code (I think we should just delete example.test.js files) and |
Some unit test cases put in |
Roger! I'll take a look, delete only example tests, keep real tests, and rename the files (or move to existing files). |
…in Rollup config because some dependencies are still CommonJS BREAKING: The new project layout might break in some tooling setups. We've added an exports field to `package.json` to specify where statements like `import ... from 'docsify'` will import from, and left the `main` and `unpkg` fields as-is for backwards compatibility with the global <script> import method. Most people who use a non-module `<script>` tag to import Docsify will not notice a difference. Anyone else who is importing Docsify into a specilized build setup using `import` statements has a chance of being broken, so we've marked this as BREAKING.
…ll request and not only for those to main or develop
I deleted the unnecessary example tests (left the good ones that were in the example files) |
Actually we can't really test unpkg or cdnjs without publishing! However, all tests still pass with the global build, and I haven't changed the tests, so this mean everything will work. When we publish to npm, then https://unpkg.com/docsify or https://unpkg.com/docsify/lib/docsify.min.js will both forward to https://unpkg.com/docsify@5/lib/docsify.min.js, and this will continue to work (same file we use in our tests). So, all apps using this HTML: <script src="https://unpkg.com/docsify"></script> or <script src="https://unpkg.com/docsify/lib/docsify.min.js"></script> will not be broken. Note, as we chatted about previously, there are quite a number of people using the URLs without version numbers: https://github.com/search?q=https%3A%2F%2Funpkg.com%2Fdocsify&type=code It looks like CDNjs URLs like https://cdn.jsdelivr.net/npm/docsify/lib/docsify.js will continue to work as well, using the same file structure. So I think we're good here. In the modernizing issue, I'll write a task for a new deprecation cycle so that we can get people off of the versionless URLs in a reasonable way without suddenly breaking them. |
@docsifyjs/core Alright, this is ready to go. Required tests passing (codesandbox build is having a sporadic issue unrelated to Docsify, resource limits being reached, and I currently have no control over that integration that @anikethsaha put in place) |
"args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"], | ||
"runtimeExecutable": "npx", | ||
"runtimeArgs": ["jest"], | ||
"args": ["-i", "${relativeFile}", "--testPathIgnorePatterns"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These scripts were out of date. Now you can run them in VS Code! Give it a try!
Alright, per our Discord convo, its going in! |
Continues from PR
Part of
Summary
Convert to ES Modules. Round two (replaces PR #1689)
What kind of change does this PR introduce?
Code style update
Refactor
Docs
Build-related changes
For any code change,
Does this PR introduce a breaking change? (check one)
Applications with build tooling relying on CommonJS may not work anymore. People with no build using the global script method of importing Docsify should not be affected.
Related issue, if any:
#2102
Tested in the following browsers:
IE