-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bump npm deps #5098
Bump npm deps #5098
Conversation
This comment has been minimized.
This comment has been minimized.
Bloody typical :-) |
@Veetaha do you have any idea why the extension doesn't start after upgrading from |
@lnicola what is the error? |
No error, it just doesn't load. |
How to reproduce this? |
Bump |
And then how do you check that it works? |
|
@lnicola Is there anything in the developer tools console? |
No, just the usual error about the proposed APIs. |
Module and bundling story in JavaScript (and even worse - TypeScript over it) is genuinely one of the worst things I've ever had to work with. I can spend hours figuring out what's wrong. Some time ago there was a warning about mixing named and default exports.
And we lived happily thereafter. Now removing @lnicola long story short I cannot easily explain whether this was a bug in I'll dare to have a luck to ask @lukastaegert to elaborate on why there was such a warning in the first place and why v13 has brought a breaking change to us. Small intro to our case: all we have at the top level is a simple vscode extension, i.e. a file with two exported functions: export async function activate(context: vscode.ExtensionContext) { }
export async function deactivate() { } |
Oof, thanks for figuring that out. |
There may be bugs in the latest version of the CJS plugin that explain the change in behaviour. We are currently reviewing how interop is handled here. Nevertheless going back to the original issue, as your entry point only has named exports and without looking into your setup too deeply I assume you transpile everything to CJS via |
Yes, we use exports.activate = activate;
exports.deactivate = deactivate; I don't know what this implicit default export for CJS means and what it is useful for, because we clearly don't do neither Thanks for the suggestions, unfortunately, we cannot easily use |
|
Aha, okay, got it, thanks for the explanation! |
bors d=Veetaha |
1 similar comment
bors d=Veetaha |
✌️ Veetaha can now approve this pull request. To approve and merge a pull request, simply reply with |
I picked 12.8.1 as that's what Code uses, at least in 1.46.1 (although we still support 1.45). 12.12 seems more arbitrary, even if they map to the same version because of semver. EDIT: whatever, newer is newer. |
Co-authored-by: Veetaha <[email protected]>
bors r+ |
We can turn off
Unless we can import those differently (what's a default import?). |
Default import is: import AliasName from "module"; Namespace import is import * as AliasName from "module"; Namespace import has only the single form, but default import can be combined with destructuring imports: import AliasName, { SymbolName1, SymbolName2 } from "module"; Default import only refers to the value exported with export default <value here>; I really don't understand why we need this complexity at all. Default import/export was created to allow for exporting a single value from the module with shorter syntax (no curly braces, no If I am not mistaken you cannot use the alias created by NamespaceImport as a function according to ECMAScript specs (but this requirement is relaxed in TypeScript I guess?). import AlaisName = require('module'); But with I myself don't know all the nitty-gritty of this stuff, I remember testing the following and it worked: - import Mocha from 'mocha';
+ import * as Mocha from 'mocha';
- import * as glob from 'glob';
+ import * as glob from 'glob'; |
My recommendation is to never use default import/export and always use namespace import or destructuring |
No description provided.