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

chai for browser is still 4.3.8? #1648

Closed
danny0838 opened this issue Oct 11, 2024 · 8 comments · Fixed by chaijs/chaijs.github.io#214
Closed

chai for browser is still 4.3.8? #1648

danny0838 opened this issue Oct 11, 2024 · 8 comments · Fixed by chaijs/chaijs.github.io#214

Comments

@danny0838
Copy link

danny0838 commented Oct 11, 2024

The hotlinking file on the website https://www.chaijs.com/chai.js has exports.version = '4.3.8';, while the latest releases in this repo are 4.5.0 and 5.1.1.

Additionally there is also Copyright(c) 2011-2014 ..., which seems very old.

I'd like to know why the browser version is outdated? Or is there some packaging issue resulting an incorrect version information?

@koddsson
Copy link
Member

Looks like it's broken and I'm not sure if we'll put in the work to fix it. Probably best to use a 3rd party CDN like jsDelivr or unpkg instead.

https://www.unpkg.com/chai@5.1.1/chai.js
https://cdn.jsdelivr.net/npm/chai@5.1.1/+esm

@danny0838
Copy link
Author

danny0838 commented Oct 11, 2024

I'm specifically talking about chai.js in browser. The file is provided in your official site, if it's broken shouldn't you either fix it or provide a working alternative to it? (Both links provided in your comment above do NOT work in a non-esm context in the browser)

@koddsson
Copy link
Member

Both links provided in your comment above do NOT work in a non-esm context in the browser

What's non-esm context? I got it working here: https://codepen.io/koddsson-the-decoder/pen/xxvgZab but I guess that's "esm context"? Do you have a reproduction for your issue?

The file is provided in your official site, if it's broken shouldn't you either fix it or provide a working alternative to it?

I just don't think it will get fixed with the number of contributions to chai right now. We welcome any pull request that fixes the issue.

@danny0838
Copy link
Author

danny0838 commented Oct 11, 2024

Non-esm context is a context without ES6 module, which is mostly browser global or AMD (require.js).

The previous chai.js in the official site supported them with a UMD-like style packaging.

@koddsson
Copy link
Member

Non-esm context is a context without ES6 module, which is mostly browser global or AMD (require.js).

JavaScript modules are available in all browsers and runtimes I can think of so that shouldn't be a problem.

If you prefer not to use JavaScript modules for whatever reason you can use chai@4 still. I made a PR to the mocha docs to showcase how this is done it you'd like to check that out: mochajs/mocha#5230

@danny0838
Copy link
Author

Thanks. Just to make sure: is there any timeline that support of v4 will end?

@koddsson
Copy link
Member

Thanks. Just to make sure: is there any timeline that support of v4 will end?

None right now. We encourage users to start upgrading their setups sooner than later as most systems should work these days with JavaScript modules and at some point we won't bother with chai@4. Most new work is also not being backported to chai@4 and all this work is on a volunteer bases. The best way to solve issues is to file Pull Requests to fix issues rather than issues :)

@danny0838
Copy link
Author

danny0838 commented Oct 18, 2024

@koddsson Checking the history, it seems that in versions above 4.3.8 (currently the latest is 4.5.0), the line exports.version = '4.3.8'; in chai.js have not been updated. Is this normal?

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 a pull request may close this issue.

2 participants