Skip to content

Commit 011bad6

Browse files
wadetandyrichmolj
authored andcommitted
Add inferred type warning in dev mode (#55)
* Add inferred type warning in dev mode When using the `@Model` decorator API, the jsonapi type will be inferred based on the class name. This is really convenient for getting up and running quickly, but when building code into a minified browser bundle, the class names are minified as well, ruining the inferrence. This commit detects if the user is running in non-production mode in a browser and provides a console warning if the inferrence code is called. * build bundle
1 parent 51d008b commit 011bad6

File tree

13 files changed

+56
-3
lines changed

13 files changed

+56
-3
lines changed

lib-esm/decorators.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/decorators.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/util/env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export declare const inBrowser: boolean;
2+
export declare const isProd: boolean;
3+
export declare const config: {
4+
productionTip: boolean;
5+
};

lib-esm/util/env.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/util/env.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/decorators.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/decorators.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util/env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export declare const inBrowser: boolean;
2+
export declare const isProd: boolean;
3+
export declare const config: {
4+
productionTip: boolean;
5+
};

0 commit comments

Comments
 (0)