Source code notes #583
Brendan-csel
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
These are unofficial notes made mostly for the author's benefit. For that reason they will focus on the web client-rendered features of Solid.
For our use-case Solid comprises two npm packages:
babel-preset-solid package
This Babel plugin is used when our project builds to compiles JSX into Solid runtime calls.
Internally this plugin just provides some default options to babel-plugin-jsx-dom-expressions that does the actual JSX compilation.
solid-js package
This provides the runtime modules that supports the output from the Babel plugin above and our own code.
solid-js module
mapArray
,indexArray
observable
requestCallback
,cancelCallback
batch
,children
,createComputed
,createContext
,createDeferred
,createEffect
,createMemo
,createRenderEffect
,createResource
,createRoot
,createSelector
,createSignal
,devComponent
,getListener
,getOwner
,getSuspenseContext
,on
,onCleanup
,onError
,onMount
,readSignal
,resumeEffects
,runWithOwner
,untrack
,useContext
,useTransition
. And some only exported in DEV mode -hashValue
,writeSignal
,registerGraph
,serializeGraph
,createComponent
,mergeProps
,splitProps
,lazy
For
,Index
,Show
,Switch
,Match
,ErrorBoundary
sharedConfig
,setHydrateContext
,nextHydrateContext
Suspense
,SuspenseList
solid-js/store module - reactive stores use proxies to track access.
createStore
,unwrap
,$RAW
createMutable
produce
,reconcile
solid-js/web module - These are the functions that actually interface with the DOM: creating elements; setting attributes; and handling events. These are called by the code generated by the Babel plugin.
Portal
andDynamic
ErrorBoundary
,For
,For
,Index
,Match
,mergeProp
,Show
,Suspense
,SuspenseList
,Switch
Aliases
,ChildProperties
,DelegatedEvents
,Properties
,SVGElements
,SVGNamespace
dom-expressions
exports some functions that are actually imported from back insolid-js/web
(so a full-circle loop - see solid/web/src/core.ts below) -createComponent
,effect=createRenderEffect
,getOwner
,memo
(and few not re-exportedroot=createRoot
,sharedConfig
,asyncWrap=awaitSuspense
)addEventListener
,Assets
,assign
,classList
,clearDelegatedEvents
,delegateEvents
,dynamicProperty
,gatherHydratable
,getHydrationKey
,getNextElement
,getNextMarker
,getNextMatch
,hydrate
,insert
,mergeProps
,NoHydration
,render
,runHydrationEvents
,setAttribute
,setAttributeNS
,spread
,style
,template
rxcore
(used indom-expressions
client.js and server.js ) with this file (see solid/rollup.config.js).Next Steps
It is likely the investigations will overlap somewhat so the approach will probably evolve.
Beta Was this translation helpful? Give feedback.
All reactions