question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.15.0] const enums are not being exported anymore

See original GitHub issue

monaco-editor version: 0.15.0

With the new 0.15.0 release, export const enum ... are not getting exported in the standaloneEditor anymore. As an example, paste this code to the playground:

require(['vs/base/common/scrollable'], ({ ScrollbarVisibility }) => {
    if (!ScrollbarVisibility) alert('ScrollbarVisibility has not been exported :(');
});

Looking at the sources, ScrollbarVisibility should get exported correctly: https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/scrollable.ts

Reading the history of that file, it looks like the changes made in this commit are causing the problem: https://github.com/Microsoft/vscode/commit/67eacaa4a856be0b90435c71de1996a12ff02f61#diff-c4d985a76a54961df57cff1260208b54

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mofuxcommented, Nov 13, 2018

Fair enough 😅Thanks for looking into this.

0reactions
alexdimacommented, Nov 13, 2018

I am sorry, but I would not accept such a PR.

I do not want our code to pay the cost at runtime of evaluating:

var Test;
(function (Test) {
    Test[Test["Hello"] = 1] = "Hello";
    Test[Test["World"] = 2] = "World";
})(Test = exports.Test || (exports.Test = {}));

for no good reason.

You are reaching into the editor internal implementation and you cannot complain when that changes or breaks. That is how libraries work, internal stuff can break or disappear at any time. We try as best we can to maintain our API surface in a backwards compatible way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[0.15.0] const enums are not being exported anymore #1179
All the API enums that are present in monaco.d.ts are correctly exported, so I don't understand why you would reach for ScrollbarVisibility in ......
Read more >
TypeScript: Don't Export const enums - ncjamieson
If you are writing a library and you export a const enum , some developers will not be able to compile their applications...
Read more >
CHANGELOG | CosmWasm Documentation
cosmwasm-std: Export GovMsg as a top-level type of the crate. ... length is not restricted to 0-64 anymore. cosmwasm-std: Use const generics ...
Read more >
CHANGELOG.md | discord_api_types@0.36.3 - Deno
APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to ...
Read more >
Version 0.15.0 released - Nim Blog
If the first statement is an import system statement then system is not imported implicitly anymore. This allows for code like import system ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found