startupjs 0.60.0-canary.0 → 0.60.0-canary.10

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.
package/auth.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@startupjs/auth/client'
package/index.d.ts CHANGED
@@ -6,9 +6,6 @@ export * from '@startupjs/hooks'
6
6
  // HINT: `isomorphic` means that the code can be executed both
7
7
  // on the server and on the client
8
8
  export * from '@startupjs/isomorphic-helpers'
9
- export { getSessionData, setSessionData, deleteSessionData } from '@startupjs/server/utils/clientSessionData'
10
- export { default as login } from '@startupjs/server/utils/clientLogin'
11
- export { default as logout } from '@startupjs/server/utils/clientLogout'
12
9
 
13
10
  export function serverOnly (value: any): any
14
11
 
package/index.js CHANGED
@@ -6,9 +6,6 @@ export * from '@startupjs/hooks'
6
6
  // HINT: `isomorphic` means that the code can be executed both
7
7
  // on the server and on the client
8
8
  export * from '@startupjs/isomorphic-helpers'
9
- export { getSessionData, setSessionData, deleteSessionData, onInitSession } from '@startupjs/server/utils/clientSessionData'
10
- export { default as login } from '@startupjs/server/utils/clientLogin'
11
- export { default as logout } from '@startupjs/server/utils/clientLogout'
12
9
 
13
10
  // wrap serverOnly around the value to remove it from the client bundle
14
11
  // (it will be replaced with `undefined` on the client by the babel-plugin-eliminator)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "startupjs",
3
3
  "type": "module",
4
- "version": "0.60.0-canary.0",
4
+ "version": "0.60.0-canary.10",
5
5
  "engines": {
6
6
  "node": ">= 14"
7
7
  },
@@ -22,21 +22,21 @@
22
22
  "./metro-babel-transformer": "./metro-babel-transformer.cjs",
23
23
  "./babel": "./babel.cjs",
24
24
  "./startupjs.config": "./startupjs.config.cjs",
25
- "./package.json": "./package.json",
26
- "./plugins/cssMediaUpdater.plugin": "./plugins/cssMediaUpdater.plugin.js"
25
+ "./package.json": "./package.json"
27
26
  },
28
27
  "bin": "./cli.js",
29
28
  "license": "MIT",
30
29
  "dependencies": {
31
- "@startupjs/bundler": "^0.60.0-canary.0",
32
- "@startupjs/cli": "^0.60.0-canary.0",
33
- "@startupjs/hooks": "^0.60.0-canary.0",
34
- "@startupjs/isomorphic-helpers": "^0.60.0-canary.0",
35
- "@startupjs/registry": "^0.60.0-canary.0",
36
- "@startupjs/server": "^0.60.0-canary.0",
37
- "@startupjs/utils": "^0.60.0-canary.0",
38
- "babel-preset-startupjs": "^0.60.0-canary.0",
39
- "cssxjs": "^0.2.10",
30
+ "@startupjs/auth": "^0.60.0-canary.8",
31
+ "@startupjs/bundler": "^0.60.0-canary.9",
32
+ "@startupjs/cli": "^0.60.0-canary.7",
33
+ "@startupjs/hooks": "^0.60.0-canary.7",
34
+ "@startupjs/isomorphic-helpers": "^0.60.0-canary.7",
35
+ "@startupjs/registry": "^0.60.0-canary.7",
36
+ "@startupjs/server": "^0.60.0-canary.7",
37
+ "@startupjs/utils": "^0.60.0-canary.7",
38
+ "babel-preset-startupjs": "^0.60.0-canary.9",
39
+ "cssxjs": "^0.2.18",
40
40
  "lodash": "^4.17.20",
41
41
  "teamplay": "^0.3.26"
42
42
  },
@@ -53,5 +53,5 @@
53
53
  "optional": true
54
54
  }
55
55
  },
56
- "gitHead": "4c5baa750402d0beb02921a38413620b348bd374"
56
+ "gitHead": "26976a305b581a0e365b183f4038dbf6b51614ef"
57
57
  }
@@ -1,47 +0,0 @@
1
- import { memo, Fragment, createElement as el, useCallback, useRef } from 'react'
2
- import { useWindowDimensions } from 'react-native'
3
- import { createPlugin } from '@startupjs/registry'
4
- import { dimensions } from 'cssxjs'
5
- import debounce from 'lodash/debounce'
6
-
7
- const DEFAULT_UPDATE_DELAY = 200
8
-
9
- export default createPlugin({
10
- name: 'cssMediaUpdater',
11
- enabled: true,
12
- order: 'system root',
13
- client: ({ updateDelay }) => ({
14
- renderRoot ({ children }) {
15
- return (
16
- el(Fragment, null,
17
- el(MediaUpdater, { updateDelay }),
18
- children
19
- )
20
- )
21
- }
22
- })
23
- })
24
-
25
- // eslint-disable-next-line react/display-name
26
- const MediaUpdater = memo(({ updateDelay = DEFAULT_UPDATE_DELAY }) => {
27
- const widthRef = useRef()
28
- // eslint-disable-next-line react-hooks/exhaustive-deps
29
- const updateWidth = useCallback(
30
- debounce(width => {
31
- if (dimensions.width !== width) {
32
- console.log('> update window width:', width)
33
- dimensions.width = width
34
- }
35
- }, updateDelay, { leading: false, trailing: true }),
36
- []
37
- )
38
- const { width } = useWindowDimensions()
39
- if (widthRef.current == null) {
40
- widthRef.current = width
41
- dimensions.width = width
42
- } else if (widthRef.current !== width) {
43
- widthRef.current = width
44
- updateWidth(width)
45
- }
46
- return null
47
- })