a concrete and detailed window 11 gui implementation. i will try to implement as many functions as possible.
this project is aiming at containing plenty of contents to achieve a complicated state for me to use different strategies for optimizing and experimenting my thoughts in some cases.
you can only perform nice optimizations on complicated project because there is no necessity to do so in simple project. you have nothing to optimize when there are just several components and one data pipeline, to be honest.
here: https://win11-desktop-virid.vercel.app/
- @mui/joy, @mui/icons-materials
- tailwindcss, styled-components
- vite, typescript, react
- rxjs
- codeium: a copilot tool. it helps a lot in shipping the code.
there are at least two stages of development:
- UI components stage
- Overall software engineering stage
for the ui stage, there are not many new things applied into the coding, and everything is just common react component. when it comes to the second stage, i think there will be more considerations on how to make code more concise and abstracted to decrease the size and enrich the utilities at the same time.
currently i am just writing the react components and some basic models for state management. it looks very simple and crude
.
overall, it's an useless project which can do nothing but only display the interface. so it will be hard to make this project better in the perspective of software engineering.
- time to try new technologies. but just try.
- styled-components has really solved some of my problems in dynamically controlling the components' style, with styled-components we don't need to switch between different
className
to show different style in different situations. - actually i don't like the css-in-js strategy because some of these has a runtime cost and will take more space in your bundle files.
- basically, the react components parts are quite ordinary, and I just have tried and experimented some of my thoughts in building better components in performance(showed as less frequently rerendered) and reusable aspect.
- the structure I put most attention to is the
context
part. I have designed aRxStore
as a basic storage service for multiple kinds of controller which require a state storage. - the
RxStore
is a mechanism which is quite similar with the core mechanism in Vue in my opinion. this means that the state stored in thisRxStore
has the capability to trigger a notification to whom is listening to it. this is very similar with what the Vue does by usingProxy
, theref
variable is tracked by Vue and in our project the change of state value is alsosubscribed
by us. - by using
subscribe
we can be notified with the exact state value change which we care about. we will be notified only if the state we subscribe changed. this is the key to decrease the frequency of rerender of our components. - btw, this
subscribe
capability is achieved byRxJS.BehaviorSubject
i am going to implement 3 kinds of Window
in this project.
- Explorer
- Setting
- Image
- framework
- framework
- framework
- detailed components in different
Window
- an overall state controller of a complicated system, just like the windows 11
- maybe some 'useful' apps like
notepad
anddraw
- add test cover.
- i want to pass less props to component
- there should be some difference between
Basic Component
andBusiness Component
- what is
Basic Component
andBusiness Component
?- Basic Component: reusable component with pure ui
- Business Component: components fulfilled with actual logic for difference usage.
- i didn't differ basic components and business components in this project.
- better abstraction. no exception.
- context: we put
windowManager
anddispatcher
andeventPipe
in context. we should only access context under react components. - store: a state store representing the states of application.
it's not correct to access modules in inappropriate level, in which case we may need a proxy to do something for us. like:
-
a proxy in component container that listening to
pipeEvent
and mount some components in purpose. -
a proxy in component container that subscribes to the state or
pipeEvent
and do some business in component domains which can't be done in common module functions. -
to be continue.
-
conclusion: i will just make it possible first, and then make it better if i have any ideas on how to do so.
- we don't operate
store
in components part, instead we usedispatcher
to trigger the operations of store. - we don't operate
components
incontext
part, instead we use aproxyOperation
to do the tasks in component modules. - TODO: currently it's just a mass. optimizations are needed.