Skip to content

Commit

Permalink
fix(strip): Combine typescript_class_properties() into strip() (#1478)
Browse files Browse the repository at this point in the history
swc_ecma_utils:
 - Use `&mut` for inject_after_super.

swc_ecma_transforms_typescript:
 - Merge `typescript_class_properties` into `strip`.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
  • Loading branch information
nayeemrmn and kdy1 authored Mar 21, 2021
1 parent 9445c10 commit 9bc074e
Show file tree
Hide file tree
Showing 32 changed files with 357 additions and 352 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.10.0"
version = "0.11.0"

[lib]
name = "swc"
Expand All @@ -31,18 +31,18 @@ swc_atoms = {version = "0.2", path = "./atoms"}
swc_common = {version = "0.10.10", path = "./common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.40.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.48.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.7.0", path = "./ecmascript/ext-transforms"}
swc_ecma_ext_transforms = {version = "0.8.0", path = "./ecmascript/ext-transforms"}
swc_ecma_parser = {version = "0.50.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.10.0", path = "./ecmascript/preset_env"}
swc_ecma_transforms = {version = "0.40.0", path = "./ecmascript/transforms", features = [
swc_ecma_preset_env = {version = "0.11.0", path = "./ecmascript/preset_env"}
swc_ecma_transforms = {version = "0.41.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
"proposal",
"react",
"typescript",
]}
swc_ecma_utils = {version = "0.30.0", path = "./ecmascript/utils"}
swc_ecma_utils = {version = "0.31.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.26.0", path = "./ecmascript/visit"}
swc_visit = {version = "0.2.3", path = "./visit"}

Expand Down
8 changes: 4 additions & 4 deletions bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"]
license = "Apache-2.0/MIT"
name = "swc_bundler"
repository = "https://github.com/swc-project/swc.git"
version = "0.27.0"
version = "0.28.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
Expand All @@ -35,16 +35,16 @@ swc_common = {version = "0.10.10", path = "../common"}
swc_ecma_ast = {version = "0.40.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.48.0", path = "../ecmascript/codegen"}
swc_ecma_parser = {version = "0.50.0", path = "../ecmascript/parser"}
swc_ecma_transforms = {version = "0.40.0", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_utils = {version = "0.30.0", path = "../ecmascript/utils"}
swc_ecma_transforms = {version = "0.41.0", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_utils = {version = "0.31.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.26.0", path = "../ecmascript/visit"}

[dev-dependencies]
hex = "0.4"
ntest = "0.7.2"
reqwest = {version = "0.10.8", features = ["blocking"]}
sha-1 = "0.9"
swc_ecma_transforms = {version = "0.40.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
swc_ecma_transforms = {version = "0.41.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
tempfile = "3.1.0"
testing = {version = "0.10.3", path = "../testing"}
url = "2.1.1"
Expand Down
60 changes: 31 additions & 29 deletions bundler/tests/fixture/deno-9591/output/entry.inlined.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ function common(paths, sep2 = SEP) {
const prefix = parts.slice(0, endOfPrefix).join(sep2);
return prefix.endsWith(sep2) ? prefix : `${prefix}${sep2}`;
}
const path1 = isWindows ? mod1 : mod2;
const path = isWindows ? mod1 : mod2;
const regExpEscapeChars = [
"!",
"$",
Expand All @@ -1344,7 +1344,7 @@ const regExpEscapeChars = [
"{",
"|"
];
const { basename: basename2 , delimiter: delimiter2 , dirname: dirname2 , extname: extname2 , format: format2 , fromFileUrl: fromFileUrl2 , isAbsolute: isAbsolute2 , join: join2 , normalize: normalize2 , parse: parse3 , relative: relative2 , resolve: resolve2 , sep: sep2 , toFileUrl: toFileUrl2 , toNamespacedPath: toNamespacedPath2 , } = path1;
const { basename: basename2 , delimiter: delimiter2 , dirname: dirname2 , extname: extname2 , format: format2 , fromFileUrl: fromFileUrl2 , isAbsolute: isAbsolute2 , join: join2 , normalize: normalize2 , parse: parse3 , relative: relative2 , resolve: resolve2 , sep: sep2 , toFileUrl: toFileUrl2 , toNamespacedPath: toNamespacedPath2 , } = path;
const rangeEscapeChars = [
"-",
"\\",
Expand Down Expand Up @@ -1851,26 +1851,26 @@ const MIN_BUF_SIZE = 16;
const CR = "\r".charCodeAt(0);
const LF = "\n".charCodeAt(0);
class BufferFullError extends Error {
name = "BufferFullError";
constructor(partial){
super("Buffer full");
this.partial = partial;
this.name = "BufferFullError";
}
}
class PartialReadError extends Deno.errors.UnexpectedEof {
name = "PartialReadError";
constructor(){
super("Encountered UnexpectedEof, data only partially read");
this.name = "PartialReadError";
}
}
class BufReader {
r = 0;
w = 0;
eof = false;
static create(r, size = 4096) {
return r instanceof BufReader ? r : new BufReader(r, size);
}
constructor(rd1, size1 = 4096){
this.r = 0;
this.w = 0;
this.eof = false;
if (size1 < 16) {
size1 = MIN_BUF_SIZE;
}
Expand Down Expand Up @@ -2073,8 +2073,6 @@ class BufReader {
}
}
class AbstractBufBase {
usedBufferBytes = 0;
err = null;
size() {
return this.buf.byteLength;
}
Expand All @@ -2084,6 +2082,10 @@ class AbstractBufBase {
buffered() {
return this.usedBufferBytes;
}
constructor(){
this.usedBufferBytes = 0;
this.err = null;
}
}
class BufWriter extends AbstractBufBase {
static create(writer, size = 4096) {
Expand Down Expand Up @@ -2257,11 +2259,11 @@ class WriterHandler extends BaseHandler {
#encoder=new TextEncoder();
}
class FileHandler extends WriterHandler {
_encoder = new TextEncoder();
#unloadCallback=()=>this.destroy()
;
constructor(levelName3, options3){
super(levelName3, options3);
this._encoder = new TextEncoder();
this._filename = options3.filename;
this._mode = options3.mode ? options3.mode : "a";
this._openOptions = {
Expand Down Expand Up @@ -5925,10 +5927,10 @@ class ADLMap {
}
}
class Manifest {
jsonBinding = createJsonBinding(RESOLVER, texprManifest());
tasks = new ADLMap([], (k1, k2)=>k1 === k2
);
constructor(dir, filename = ".manifest.json"){
this.jsonBinding = createJsonBinding(RESOLVER, texprManifest());
this.tasks = new ADLMap([], (k1, k2)=>k1 === k2
);
this.filename = mod3.join(dir, filename);
}
async load() {
Expand Down Expand Up @@ -5957,10 +5959,10 @@ class Manifest {
}
}
class TaskManifest {
lastExecution = null;
trackedFiles = new ADLMap([], (k1, k2)=>k1 === k2
);
constructor(data1){
this.lastExecution = null;
this.trackedFiles = new ADLMap([], (k1, k2)=>k1 === k2
);
this.trackedFiles = new ADLMap(data1.trackedFiles, (k1, k2)=>k1 === k2
);
this.lastExecution = data1.lastExecution;
Expand All @@ -5982,9 +5984,9 @@ class TaskManifest {
}
}
class AsyncQueue {
inProgress = 0;
queue = [];
constructor(concurrency){
this.inProgress = 0;
this.queue = [];
this.concurrency = concurrency;
}
async schedule(t) {
Expand Down Expand Up @@ -6017,16 +6019,16 @@ class AsyncQueue {
}
}
class ExecContext {
taskRegister = new Map();
targetRegister = new Map();
doneTasks = new Set();
inprogressTasks = new Set();
internalLogger = mod4.getLogger("internal");
taskLogger = mod4.getLogger("task");
userLogger = mod4.getLogger("user");
constructor(manifest, args){
this.manifest = manifest;
this.args = args;
this.taskRegister = new Map();
this.targetRegister = new Map();
this.doneTasks = new Set();
this.inprogressTasks = new Set();
this.internalLogger = mod4.getLogger("internal");
this.taskLogger = mod4.getLogger("task");
this.userLogger = mod4.getLogger("user");
if (args["verbose"] !== undefined) {
this.internalLogger.levelName = "INFO";
}
Expand Down Expand Up @@ -6071,8 +6073,8 @@ async function statPath(path1) {
}
}
class Task {
taskManifest = null;
constructor(taskParams){
this.taskManifest = null;
this.name = taskParams.name;
this.action = taskParams.action;
this.description = taskParams.description;
Expand Down Expand Up @@ -6199,11 +6201,11 @@ class Task {
}
}
class TrackedFile {
path = "";
#getHash;
#getTimestamp;
fromTask = null;
constructor(fileParams){
this.path = "";
this.fromTask = null;
this.path = mod3.posix.resolve(fileParams.path);
this.#getHash = fileParams.getHash || getFileSha1Sum;
this.#getTimestamp = fileParams.getTimestamp || getFileTimestamp;
Expand Down Expand Up @@ -6293,9 +6295,9 @@ class TrackedFile {
}
}
class TrackedFilesAsync {
kind = 'trackedfilesasync';
constructor(gen){
this.gen = gen;
this.kind = 'trackedfilesasync';
}
async getTrackedFiles() {
return this.gen();
Expand Down
Loading

0 comments on commit 9bc074e

Please sign in to comment.