Comments (2)
Further investigating this issue I found, that using the test.ts
above Deno.transpileOnly(...)
is responsible to give the following and obviously faulty result:
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {
};
Object.keys(descriptor).forEach(function(key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ("value" in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function(desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object.defineProperty(target, property, desc);
desc = null;
}
return desc;
}
var _class, _dec, _dec;
function A() {
console.log("@A evaluated");
return function(target, propertyKey, descriptor) {
console.log("@A called");
const fn = descriptor.value;
descriptor.value = function() {
console.log("fn() called from @A");
fn();
};
};
}
function B() {
console.log("@B evaluated");
return function(target, propertyKey, descriptor) {
console.log("@B called");
const fn = descriptor.value;
descriptor.value = function() {
console.log("fn() called from @B");
fn();
};
};
}
let C = ((_class = class C {
static test() {
console.log("C.test() called");
}
}) || _class, _dec = A(), _dec = B(), _applyDecoratedDescriptor(_class, "test", [_dec, _dec], Object.getOwnPropertyDescriptor(_class, "test"), _class), _class);
C.test();
However, Deno.compile(...)
emits properly working code:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
function A() {
console.log("@A evaluated");
return function (target, propertyKey, descriptor) {
console.log("@A called");
const fn = descriptor.value;
descriptor.value = function () {
console.log("fn() called from @A");
fn();
};
};
}
function B() {
console.log("@B evaluated");
return function (target, propertyKey, descriptor) {
console.log("@B called");
const fn = descriptor.value;
descriptor.value = function () {
console.log("fn() called from @B");
fn();
};
};
}
class C {
static test() {
console.log("C.test() called");
}
}
__decorate([
A(),
B()
], C, "test", null);
C.test();
The default in denopack
is to use Deno.transpileOnly
.
Using pluginTypescriptCompile
gives error:
error: Uncaught (in promise) TypeError: Cannot read property 'includes' of undefined
if (!files.includes(jsFile)) {
^
at resolveFromModules (mod.ts:21:14)
at Object.transform (mod.ts:72:35)
at https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:334078
from denopack.
Related Deno issue denoland/deno#8412
from denopack.
Related Issues (19)
- DENO_DIR is not set HOT 5
- Support for top-level await HOT 11
- bug: non root html emit does not work HOT 1
- Support import maps HOT 2
- [BUG] pluginCssBundle doesn't resolve locations correctly
- deno fmt precommit hook
- Remote debugging in VS Code HOT 1
- [BUG] Installation error in Deno 1.5.x: CertNotValidForName HOT 4
- [BUG] Getting a 500 Internal Server Error while installing HOT 1
- [BUG] Cannot destructure property 'output' HOT 3
- [BUG] Debugging experience is very poor HOT 4
- [BUG] Ignores directories in output filename/sourcemap HOT 1
- [Problem]: No longer works with Deno 1.7.0
- [BUG] Can't install (No such host is known.)
- Move readme to docs site
- TS error in rollup dependency on package install/run HOT 8
- Frontend related roadmap
- Polyfilled Node version of Rollup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denopack.