Replies: 3 comments 1 reply
-
我目前设想 API 类似如下的调用: import { create, Workbench } from '@molecule/ide';
import '@dtinsight/molecule/esm/style/mo.css';
const moInstance = create({
defaultLocale: '',
extensions: [],
}, );
const App = () => moInstance.render(<Workbench />);
ReactDOM.render(<App />, document.getElementById('root')); 其他 API 调用: // Inactive specify extension
moInstance.extension.inactive(() => ());
// activityBar add
moInstance.activityBar.add(); |
Beta Was this translation helpful? Give feedback.
-
RFC: Re-design the life cycle of molecule instantiationGoals
BackgroundWe met the life cycle problems several times. And the ProposalIn order to let molecule to be a standalone application, we can have a standaloneService so that we can have a service to control the count of instantiation. And we also need a instantiationService to control the whole life cycle of current instantiation. And we can define the orders of Services. We still export a function called create, so user could call create function to get the instantiation of molecule, and everything belongs to this instantiation. const moInstance = create({
defaultLocale: '',
extensions: [],
}, );
const App = () => moInstance.render(<Workbench />);
ReactDOM.render(<App />, document.getElementById('root')); Besides, we still export the Provider to compatible with the older usage of molecule. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions