Skip to content

Commit

Permalink
build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Apr 10, 2020
1 parent c36fc69 commit aae6183
Show file tree
Hide file tree
Showing 5 changed files with 604 additions and 455 deletions.
18 changes: 17 additions & 1 deletion notes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Initial build process


Original:
---------
Import size report for mobx:
┌──────────────────────┬───────────┬────────────┬───────────┐
│ (index) │ just this │ cumulative │ increment │
Expand All @@ -12,6 +13,21 @@ Import size report for mobx:
└──────────────────────┴───────────┴────────────┴───────────┘
(this report was generated by npmjs.com/package/import-size)

After removing decorators;
-----------------
Import size report for mobx:
┌──────────────────────┬───────────┬────────────┬───────────┐
│ (index) │ just this │ cumulative │ increment │
├──────────────────────┼───────────┼────────────┼───────────┤
│ import * from 'mobx' │ 17581 │ 0 │ 0 │
│ observable │ 14563 │ 14563 │ 0 │
│ computed │ 14563 │ 14577 │ 14 │
│ autorun │ 14563 │ 14590 │ 13 │
│ action │ 14563 │ 14602 │ 12 │
│ enableDecorators │ 14566 │ 14617 │ 15 │
└──────────────────────┴───────────┴────────────┴───────────┘
(this report was generated by npmjs.com/package/import-size)


[ ] TSDX build process
[ ] enableDecorators
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,33 @@
"homepage": "https://mobx.js.org/",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.3.0",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-typescript": "^7.9.0",
"@babel/runtime": "^7.3.4",
"@size-limit/preset-big-lib": "^3.0.0",
"@babel/runtime": "^7.8.4",
"@rollup/plugin-node-resolve": "^7.1.1",
"@size-limit/preset-big-lib": "^4.0.2",
"@types/jest": "^24.0.11",
"@types/jscodeshift": "^0.6.3",
"@types/node": "^11.11.3",
"@typescript-eslint/eslint-plugin": "^1.4.2",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^24.5.0",
"conditional-type-checks": "^1.0.4",
"coveralls": "^3.0.3",
"dedent-js": "^1.0.1",
"import-size": "^1.0.2",
"jscodeshift": "^0.7.0",
"lint-staged": "^8.1.5",
"eslint": "^6.8.0",
"flow-bin": "^0.59.0",
"fs-extra": "^8.1.0",
"husky": "^4.2.3",
"import-size": "^1.0.2",
"iterall": "^1.2.2",
"jest": "^24.5.0",
"jscodeshift": "^0.7.0",
"lint-staged": "^8.1.5",
"prettier": "^1.19.1",
"pretty-quick": "2.0.1",
"prompts": "^2.3.0",
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function runTypeScriptBuild(outDir, version, target, declarations) {
options.module = ts.ModuleKind.ESNext
options.importHelpers = true
options.noEmitHelpers = true
options.noEmit = false
if (declarations) options.declarationDir = path.resolve("dist", version, "lib")

const rootFile = path.resolve(options.rootDir, "mobx.ts")
Expand Down Expand Up @@ -153,7 +154,7 @@ async function build(version) {
writePackage(versionPath, version)
}

Promise.all([build("v4"), build("v5")]).catch(e => {
Promise.all([/* TODO: build("v4"), */ build("v5")]).catch(e => {
console.error(e)
if (e.frame) {
console.error(e.frame)
Expand Down
6 changes: 4 additions & 2 deletions src/v5/api/makeObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
endBatch,
startBatch,
CreateObservableOptions,
ObservableObjectAdministration
ObservableObjectAdministration,
invariant
} from "../internal"
import { invariant } from "../../v4/internal"

function getDecoratorsFromMetaData<T extends Object>(target: T): AnnotationsMap<T> {
fail("not implemented yet")
Expand Down Expand Up @@ -163,11 +163,13 @@ export function makeObservable<T extends Object>(
}
}

// TODO: add tests
export function makeAutoObservable<T extends Object>(
target: T,
excludes: AnnotationsMap<T>,
options: CreateObservableOptions
) {
// TODO: die on things with superclass
let annotations = { ...excludes }
extractAnnotationsFromObject(target, annotations, options)
extractAnnotationsFromProto(target, annotations)
Expand Down
Loading

0 comments on commit aae6183

Please sign in to comment.