@tamagui/use-force-update 2.0.0-rc.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var index_exports = {};
33
35
  __export(index_exports, {
34
36
  isServerSide: () => isServerSide,
@@ -36,8 +38,8 @@ __export(index_exports, {
36
38
  });
37
39
  module.exports = __toCommonJS(index_exports);
38
40
  var import_react = __toESM(require("react"), 1);
39
- const isServerSide = typeof window > "u",
40
- idFn = () => {};
41
+ const isServerSide = typeof window === "undefined";
42
+ const idFn = () => {};
41
43
  function useForceUpdate() {
42
44
  return isServerSide ? idFn : import_react.default.useReducer(x => Math.random(), 0)[1];
43
45
  }
@@ -4,42 +4,44 @@ var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
18
  get: () => from[key],
18
19
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
20
  });
20
- return to;
21
- };
21
+ }
22
+ return to;
23
+ };
22
24
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
+ value: true
35
+ }), mod);
34
36
  var index_exports = {};
35
37
  __export(index_exports, {
36
38
  isServerSide: () => isServerSide,
37
39
  useForceUpdate: () => useForceUpdate
38
40
  });
39
41
  module.exports = __toCommonJS(index_exports);
40
- var import_react = __toESM(require("react"), 1),
41
- isServerSide = !1,
42
- idFn = function () {};
42
+ var import_react = __toESM(require("react"), 1);
43
+ var isServerSide = false;
44
+ var idFn = function () {};
43
45
  function useForceUpdate() {
44
46
  return isServerSide ? idFn : import_react.default.useReducer(function (x) {
45
47
  return Math.random();
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","isServerSide","useForceUpdate","module","exports","import_react","__toESM","require","idFn","default","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAkB,CAAAK,aAAA;AAEX,IAAAM,YAAM,GAAAC,OAC6B,CAAAC,OAAO,QAE3C;EAAON,YAAM;EAAAO,IAAA,YAAAA,CAAA,GAAC;AAEb,SAASN,eAAA,EAA6B;EAC3C,OAAOD,YAAA,GACHO,IAAA,GACCH,YAAA,CAAAI,OAAA,CAAMC,UAAA,CAAW,UAAOC,CAAA,EAAK;IACpC,OAAAC,IAAA,CAAAC,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["isNodeMode","mod","__esModule","__defProp","target","value","enumerable","__toCommonJS","__copyProps","index_exports","__export","isServerSide","useForceUpdate","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,UAAA,KAAAC,GAAA,KAAAA,GAAA,CAAAC,UAAA,GAAAC,SAAA,CAAAC,MAAA;EAAAC,KAAA,EAAAJ,GAAA;EAAAK,UAAA;AAAA,KAAAF,MAAA,EAAAH,GAAA;AAAA,IAAAM,YAAA,GAAkBN,GAAA,IAAAO,WAAA,CAAAL,SAAA;EAAAE,KAAA;AAAA,IAAAJ,GAAA;AAEX,IAAAQ,aAAM,IACX;AAEFC,QAAM,CAAAD,aAAa;EAACE,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAEbC,cAAS,EAAAA,CAAA,KAAAA;AACd;AAGFC,MAAA,CAAAC,OAAA,GAAAP,YAAA,CAAAE,aAAA","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,11 +1,8 @@
1
1
  import React from "react";
2
- const isServerSide = typeof window > "u", idFn = () => {
3
- };
2
+ const isServerSide = typeof window === "undefined";
3
+ const idFn = () => {};
4
4
  function useForceUpdate() {
5
- return isServerSide ? idFn : React.useReducer((x) => Math.random(), 0)[1];
5
+ return isServerSide ? idFn : React.useReducer(x => Math.random(), 0)[1];
6
6
  }
7
- export {
8
- isServerSide,
9
- useForceUpdate
10
- };
7
+ export { isServerSide, useForceUpdate };
11
8
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,OAAO,WAAW;AAEX,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAA6B;AAC3C,SAAO,eACH,OACC,MAAM,WAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AAClD;",
5
- "names": []
6
- }
1
+ {"version":3,"names":["React","isServerSide","window","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,YAAA,GACX,OAAAC,MAAY;AAEd,MAAMC,IAAA,GAAOA,CAAA,KAAM;AAAC,SAAAC,eAAA;EAEb,OAAAH,YAAS,GAAAE,IAA6B,GAAAH,KAAA,CAAAK,UAAA,CAAAC,CAAA,IAAAC,IAAA,CAAAC,MAAA;AAC3C;AAGF,SAAAP,YAAA,EAAAG,cAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- const isServerSide = typeof window > "u",
3
- idFn = () => {};
2
+ const isServerSide = typeof window === "undefined";
3
+ const idFn = () => {};
4
4
  function useForceUpdate() {
5
5
  return isServerSide ? idFn : React.useReducer(x => Math.random(), 0)[1];
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","isServerSide","window","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,YAAA,GAC6B,OAAOC,MAAA,GAAW;EAEtDC,IAAA,GAAOA,CAAA,KAAM,CAAC;AAEb,SAASC,eAAA,EAA6B;EAC3C,OAAOH,YAAA,GACHE,IAAA,GACCH,KAAA,CAAMK,UAAA,CAAYC,CAAA,IAAMC,IAAA,CAAKC,MAAA,CAAO,GAAG,CAAC,EAAE,CAAC;AAClD","ignoreList":[]}
1
+ {"version":3,"names":["React","isServerSide","window","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,YAAA,GACX,OAAAC,MAAY;AAEd,MAAMC,IAAA,GAAOA,CAAA,KAAM;AAAC,SAAAC,eAAA;EAEb,OAAAH,YAAS,GAAAE,IAA6B,GAAAH,KAAA,CAAAK,UAAA,CAAAC,CAAA,IAAAC,IAAA,CAAAC,MAAA;AAC3C;AAGF,SAAAP,YAAA,EAAAG,cAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- var isServerSide = !1,
3
- idFn = function () {};
2
+ var isServerSide = false;
3
+ var idFn = function () {};
4
4
  function useForceUpdate() {
5
5
  return isServerSide ? idFn : React.useReducer(function (x) {
6
6
  return Math.random();
@@ -1 +1 @@
1
- {"version":3,"names":["React","isServerSide","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,IAAAC,YAAM,KAC6B;EAAAC,IAAA,GAAO,SAAAA,CAAA,EAAW,CAExC;AAEb,SAASC,eAAA,EAA6B;EAC3C,OAAOF,YAAA,GACHC,IAAA,GACCF,KAAA,CAAMI,UAAA,CAAW,UAAOC,CAAA,EAAK;IACpC,OAAAC,IAAA,CAAAC,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["React","isServerSide","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,IAAAC,YAAM,QACX;AAEF,IAAAC,IAAM,YAAAA,CAAA,EAAa;AAAC,SAAAC,eAAA;EAEb,OAAAF,YAAS,GAAAC,IAA6B,GAAAF,KAAA,CAAAI,UAAA,WAAAC,CAAA;IAC3C,OAAOC,IAAA,CAAAC,MAAA;EAGT","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-force-update",
3
- "version": "2.0.0-rc.8",
3
+ "version": "2.0.0",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "files": [
6
6
  "src",
@@ -16,15 +16,12 @@
16
16
  "./package.json": "./package.json",
17
17
  ".": {
18
18
  "types": "./types/index.d.ts",
19
- "react-native": {
20
- "module": "./dist/esm/index.native.js",
21
- "import": "./dist/esm/index.native.js",
22
- "require": "./dist/cjs/index.native.js"
23
- },
19
+ "react-native": "./dist/esm/index.native.js",
20
+ "browser": "./dist/esm/index.mjs",
24
21
  "module": "./dist/esm/index.mjs",
25
22
  "import": "./dist/esm/index.mjs",
26
23
  "require": "./dist/cjs/index.cjs",
27
- "default": "./dist/cjs/index.native.js"
24
+ "default": "./dist/esm/index.mjs"
28
25
  }
29
26
  },
30
27
  "publishConfig": {
@@ -37,7 +34,7 @@
37
34
  "clean:build": "tamagui-build clean:build"
38
35
  },
39
36
  "devDependencies": {
40
- "@tamagui/build": "2.0.0-rc.8",
37
+ "@tamagui/build": "2.0.0",
41
38
  "react": ">=19"
42
39
  },
43
40
  "peerDependencies": {
@@ -1,13 +1,11 @@
1
1
  {
2
- "mappings": "AAEA,OAAO,cAAMA;AAKb,OAAO,iBAAS",
3
- "names": [
4
- "isServerSide: boolean"
5
- ],
2
+ "mappings": "AAEA,OAAO,cAAM;AAKb,OAAO,iBAAS",
3
+ "names": [],
6
4
  "sources": [
7
5
  "src/index.ts"
8
6
  ],
7
+ "version": 3,
9
8
  "sourcesContent": [
10
9
  "import React from 'react'\n\nexport const isServerSide: boolean =\n process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate(): () => void {\n return isServerSide\n ? idFn\n : (React.useReducer((x) => Math.random(), 0)[1] as () => void)\n}\n"
11
- ],
12
- "version": 3
10
+ ]
13
11
  }
package/dist/cjs/index.js DELETED
@@ -1,35 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var index_exports = {};
24
- __export(index_exports, {
25
- isServerSide: () => isServerSide,
26
- useForceUpdate: () => useForceUpdate
27
- });
28
- module.exports = __toCommonJS(index_exports);
29
- var import_react = __toESM(require("react"), 1);
30
- const isServerSide = typeof window > "u", idFn = () => {
31
- };
32
- function useForceUpdate() {
33
- return isServerSide ? idFn : import_react.default.useReducer((x) => Math.random(), 0)[1];
34
- }
35
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAEX,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAA6B;AAC3C,SAAO,eACH,OACC,aAAAA,QAAM,WAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AAClD;",
5
- "names": ["React"]
6
- }