Commit Graph

1681 Commits

Author SHA1 Message Date
Bowen Tan
462787183e build(editor-sdk): remove emotion/react 2022-09-16 16:04:06 +08:00
yz-yu
569f708a8d
Merge pull request #591 from smartxworks/slot-fallback
fix(runtime): fix #590, use an init set to check first time render
2022-09-15 12:04:26 +08:00
tanbowensg
1c2ca04fe6
Merge pull request #602 from smartxworks/fix/dry
Fix the bug of table
2022-09-14 14:23:47 +08:00
xzdry
3b367d3b48 fix(Table): illegal default current page is automatically fixed to 1 2022-09-14 11:36:16 +08:00
xzdry
58a58cffc5 feat(arco/Table): allow custom rowkey 2022-09-14 11:29:52 +08:00
tanbowensg
378dbb23a2
Merge pull request #601 from smartxworks/fix/dry
fix: generate array items defaults only when generating state examples
2022-09-13 14:44:53 +08:00
xzdry
8f079d7731 fix: supplement test for generateDefaultValueFromSpec 2022-09-13 10:52:05 +08:00
xzdry
5c2e03d8f7 fix: generate array items defaults only when generating state examples 2022-09-13 10:15:30 +08:00
Yanzhen Yu
b5c4fb487a test(runtime): add unit tests for the new state LCM 2022-09-12 16:56:55 +08:00
Yanzhen Yu
0644dbf01e fix(runtime): only update stateManager init set when store update 2022-09-12 16:49:30 +08:00
Yanzhen Yu
c84d94a89a fix(runtime): fix #590, use an init set to check first time render
This patch use a more solid way to check init state setup, instead of render count.
2022-09-12 16:42:08 +08:00
tanbowensg
8e59b852ec
Merge pull request #593 from smartxworks/fix/arco
add slot key for table and remove tabs placeholder
2022-09-09 10:36:11 +08:00
xzdry
c0d6ce8879 refactor(arco/Table): rollback table's slot name
Because this is a breaking change, the name will remain content for now until the upgrade tool is
implemented
2022-09-09 09:39:52 +08:00
yz-yu
5eb5551a24
Merge pull request #599 from smartxworks/build/update-emotion
build(*): update emotion/react
2022-09-09 08:33:58 +08:00
yz-yu
19c533d12b
Merge pull request #595 from smartxworks/build/framer-motion
fix(build): downgrade framer-motion from 4 to 3
2022-09-09 08:33:28 +08:00
Bowen Tan
e286c3683f build(*): update emotion/styled & emotion/react 2022-09-08 17:59:49 +08:00
Bowen Tan
73242820fa fix(build): downgrade framer-motion from 4 to 3 2022-09-07 16:12:09 +08:00
tanbowensg
5b866cb310
Merge pull request #589 from smartxworks/fix/booleanfield
fix(BooleanField): convert only the values that exist
2022-09-05 10:54:26 +08:00
xzdry
8e56d5e652 refactor(arco/Tabs): remove placehoder
In some cases, tabs may not always have slots, so there is no need for placeholders here
2022-09-05 10:45:08 +08:00
yz-yu
0b65f85663
Merge pull request #592 from smartxworks/fix/windlike-dev
fix(slot): fix fallback disappearing when remounted
2022-09-05 09:59:40 +08:00
MrWindlike
0a79437e75 fix(slot): fix fallback disappearing when remounted 2022-09-05 09:48:03 +08:00
xzdry
da5d342ef6 feat(arco/Table): add slot key 2022-09-05 09:31:07 +08:00
yz-yu
27bc77129e
Merge pull request #575 from smartxworks/build/dyanmic-import
Optimize bundle size
2022-09-03 21:51:52 +08:00
xzdry
25662863a7 fix(BooleanField): convert only the values that exist 2022-09-02 18:10:04 +08:00
tanbowensg
caf7eb2eeb
Merge pull request #586 from smartxworks/feat/slot
add slot key
2022-09-01 15:49:01 +08:00
yz-yu
c5fbcdf9af
Merge pull request #585 from smartxworks/feat/highlight-hover
feat(mask): highlight component in canvas when user hover it in tree
2022-09-01 15:36:06 +08:00
xzdry
1d6dc154fc feat(arco-lib/table): add default value 2022-09-01 13:17:29 +08:00
Bowen Tan
0bcfff673e feat(mask): highlight component in canvas when user hover it in tree 2022-09-01 10:22:25 +08:00
xzdry
9cb7ffcaad feat(arco-lib): add slot key 2022-09-01 09:58:50 +08:00
Bowen Tan
8e2a7d580f Merge branch 'develop' into build/dyanmic-import
* develop:
  fix(ValidationTrait): don't clear existing errors
  fix(StateManager): fix the can't deep eval the nest array issues
  feat(runtime): add style for ErrorBoundary
  feat(runtime): add ErrorBoundary to ImplWrapper
  refactor(runtime): refactor utilMethodFactory type
  refactor(runtime): add slot receiver to app services
  refactor(runtime): temporary hack the list component with the new slot system
  refactor(runtime): remove slot props from event trait
  perf(runtime): implement slot receiver to avoid of re-render when passing fallback elements
  perf(runtime): refactor the slot's props and fallback implementation
  fix(SpaceWidget): fix padding display misalignment
  fix: fix selecting component would change the properties' values issue
  refactor: remove the shared package from core
  fix: fix the `exampleProperties` type errors

# Conflicts:
#	packages/chakra-ui-lib/src/index.ts
2022-08-31 14:09:21 +08:00
tanbowensg
83173e85bd
Merge pull request #579 from smartxworks/fix/windlike-dev
fix(ValidationTrait): don't clear existing errors
2022-08-31 14:05:55 +08:00
tanbowensg
064d8d7031
Merge pull request #576 from smartxworks/refactor/util-method
refactor(runtime): refactor utilMethodFactory type
2022-08-30 16:24:08 +08:00
MrWindlike
d9cc0aaf6b fix(ValidationTrait): don't clear existing errors 2022-08-30 11:43:54 +08:00
yz-yu
e05407f653
Merge pull request #577 from smartxworks/feat/runtime-error-boundary
feat(runtime): add ErrorBoundary to ImplWrapper
2022-08-26 13:01:22 +08:00
yz-yu
a17f92aaa3
Merge pull request #578 from smartxworks/fix/windlike-dev
fix(StateManager): fix the can't deep eval the nest array issues
2022-08-26 13:01:04 +08:00
MrWindlike
c72e29b467 fix(StateManager): fix the can't deep eval the nest array issues 2022-08-26 11:38:19 +08:00
Bowen Tan
7ea0acea20 feat(runtime): add style for ErrorBoundary 2022-08-25 11:02:49 +08:00
Bowen Tan
5d2a64f575 feat(runtime): add ErrorBoundary to ImplWrapper 2022-08-25 10:48:04 +08:00
Bowen Tan
81c6d03b54 refactor(runtime): refactor utilMethodFactory type 2022-08-24 14:42:15 +08:00
tanbowensg
dcd7dd6424
Merge pull request #553 from smartxworks/slot-fallback
use the new data path to pass slot props and fallback elements
2022-08-23 18:28:58 +08:00
Bowen Tan
bcc5b2fd7b build(ci.yml): upgrade node version in ci 2022-08-23 17:09:17 +08:00
Bowen Tan
6d06bb8514 refactor(*): beautify code 2022-08-23 15:22:02 +08:00
Bowen Tan
373cfb9ba9 refactor(editor): replace codemirror with react-codemirror2 2022-08-23 13:56:44 +08:00
Yanzhen Yu
5b01477c62 refactor(runtime): add slot receiver to app services 2022-08-23 10:41:04 +08:00
Yanzhen Yu
1c505334c7 refactor(runtime): temporary hack the list component with the new slot system 2022-08-23 10:28:08 +08:00
Yanzhen Yu
b1012217ee refactor(runtime): remove slot props from event trait 2022-08-23 10:28:08 +08:00
Yanzhen Yu
ef2669992f perf(runtime): implement slot receiver to avoid of re-render when passing fallback elements
The slot receiver is a magic hole of sunmao's runtime.
In sunmao, we support pass props and fallback elements to a slot.
But if we pass them as React component's props,
it will cause re-render since most of them could not use a shallow equal checker.

Also, in sunmao's runtime, we are not using a traditional React render mechanism.
Instead, we keep most of the components not be rendered and only subscribe to related state updates.

To continue with our design,
we need a way to render slot's fallback elements without passing the elements as props.
This is where the slot receiver comes.
It contains a map and an event emitter, when a slot need render,
it will attach the fallback elements to the map and send a signal via the emitter.
When the Receiver component receive a signal, it will force render the fallback elements.

related: #388
2022-08-23 10:28:06 +08:00
Yanzhen Yu
b5df69f21c perf(runtime): refactor the slot's props and fallback implementation
The main idea of this patch is to set slot props to a reactive store
instead of passing them as React props to the slot children elements.

Same as other state management in sunmao, the component will subscribe
to the slot store to get the latest value of slot props.

Same as component id, we need a way to identify every slot props in the store.
So we add a new parameter key to the `getSlot` function,
where [component id, slot name, key] will be a unique identifier.

Another challenge is to subscribe the slot store in a efficient way.
Currently we are using vue's reactivity system, which need set `deep: true`
to observe multiple value during effect.

By setting `deep: true`, if we write code like `const $slot = slotStore[slotKey]`,
it will subscribe all the sub-fields of this slot key be cause we 'access' the property.

The solution is to implement a redirector Proxy.
With the redirector, expression `$slot.a.b` will be redirect to `slotStore[slotKey].a.b`.

related to: #388
2022-08-23 10:26:18 +08:00
Bowen Tan
ab60a14972 build(expressionEditor): dynamic import expression editor 2022-08-19 16:35:30 +08:00
Bowen Tan
42f965bf4d build(vite-plugins): add type
fix(hh): hhhh
2022-08-19 15:56:35 +08:00