You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there was a way to register commands instead of (or in addition to) scanning the commands/ dir, we could drop most of the existing command modules.
The build-<inferno|preact|react|web>[-app].js, serve-<inferno|preact|react|web>[-app].js and test-<inferno|preact|react>.js commands are now just passing different configs to the same functions - being able to register these dynamically instead would allow us to get rid of 19 modules right off the bat and also be a first step to making nwb's core more plugin-based.
The generic build, clean and serve and test commands are just mapping project types to other existing commands.
The inferno, preact, react and web quick commands are also just mapping to the appropriate build or serve command, and they're mostly duplicates of each other save for differences in the options and defaults in the help output. If we do a 4-way diff of these we might be able to extract the common parts and enable passing just the differences in help output for display.
The build-demo (really should be build-react-demo) and serve-react-demo commands are still hardcoding all the config they need - if we can figure out which changes need to be made to pull that from react/index.js instead we could also look at making it easy to add serve-X-demo, build-X-component and build-X-demo for other libraries too the same was as we've done with appConfig and quickConfig (perhaps this para should be a separate issue?)
@loklaan already has an initial stab at an API for this in #292
The text was updated successfully, but these errors were encountered:
If there was a way to register commands instead of (or in addition to) scanning the
commands/
dir, we could drop most of the existing command modules.The
build-<inferno|preact|react|web>[-app].js
,serve-<inferno|preact|react|web>[-app].js
andtest-<inferno|preact|react>.js
commands are now just passing different configs to the same functions - being able to register these dynamically instead would allow us to get rid of 19 modules right off the bat and also be a first step to making nwb's core more plugin-based.The generic
build
,clean
andserve
andtest
commands are just mapping project types to other existing commands.The
inferno
,preact
,react
andweb
quick commands are also just mapping to the appropriatebuild
orserve
command, and they're mostly duplicates of each other save for differences in the options and defaults in the help output. If we do a 4-way diff of these we might be able to extract the common parts and enable passing just the differences in help output for display.The
build-demo
(really should bebuild-react-demo
) andserve-react-demo
commands are still hardcoding all the config they need - if we can figure out which changes need to be made to pull that fromreact/index.js
instead we could also look at making it easy to addserve-X-demo
,build-X-component
andbuild-X-demo
for other libraries too the same was as we've done withappConfig
andquickConfig
(perhaps this para should be a separate issue?)@loklaan already has an initial stab at an API for this in #292
The text was updated successfully, but these errors were encountered: