Open flevi29 opened 10 months ago
Okay, I might go a little overboard with this one. For all of this to be as good as it can possibly be, it was best for me to move the project to "type": "module"
, but Jest doesn't like that very much. However I found out that Jest is poorly maintained (at least a lot poorer than in its glory days) these days, and essentially abandoned by Facebook/Meta, so it's probably best to switch to a different testing framework.
I chose Vitest, quite popular and Jest compatible.
Also tests/env
for some reason is failing again so I need to fiddle with that too.
Since cross-fetch
is CJS only (unless bundled correctly, but even at that it's not done right at the current moment), and we're moving to Node.js 18, 20 which have builtin fetch
, I'm dropping cross-fetch
. I can see that a custom HTTP request method can be provided, so this shouldn't be an issue for people with outdated runtimes.
I need to know if we really want to support Internet Explorer 11, so I know what version of ES to bundle the UMD to.
(I'm repeating myself here, but currently we are very much NOT supporting Internet Explorer 11, because cross-fetch
is bundled incorrectly #1610)
Also tests/env for some reason is failing again so I need to fiddle with that too.
This was very confusing for me. The files contained a path to the dist UMD bundle, didn't realize at first that they're supposed to be hard links. Now that I know what they are, I could fix them. But it is very much not recommended to have these things in your codebase. http://tdongsi.github.io/blog/2016/02/20/symlinks-in-git/
I would like to add that any change that might come from this issue or others that change the configurations for the better is very welcomed, but they should work with our existing playgrounds.
Example:
Due to the change made here we introduced an extra step to the end user when they are using Vue3 on Vite (possibly all vite envs).
Yeah, sorry about that, I should've tested the playgrounds as well. I'm not sure why it worked beforehand, I need to investigate further. But I have plans that addresses this as well, the way the code is split up for Node.js and browsers is not ideal, and can cause surprises like the one you mentioned.
Yeah, that would be awesome if we could improve that and avoid those issues in the future, I'm looking forward to see it!
Rollup
Has many questionable configurations, plugins. TypeScript is related, but for the most part that will be done by #1616.
npm
, these are unnecessarily minifiedpackage.json
main
field)"target": "ES6"
), the thing about down leveled code is that it can no longer be up leveled, the down leveling should mostly be the concern of the package users bundlerpackage.json
browser
field points to the UMD bundle, but this field is primarily meant for bundlersjsdelivr
field for that, so it'll never look atbrowser
field https://www.jsdelivr.com/documentation#id-configuring-a-default-file-in-packagejsonMore details in upcoming PR.