First, I am immensely grateful to all Dojo 2 contributors for bringing this to fruition. Your thoughtfulness and ingenuity have kept me a Dojo supporter and user for many years.
I mostly use Dojo 1 within PHP based applications and I am trying to figure out the migration path for my team to Dojo 2.
In Dojo 1:
- I can instantiate any module either declaratively (using the parser and data-dojo-type attribute) or imperatively (requiring it in another module or directly on the page and using it).
- Modules are all loaded lazily by default and I can bundle them into builds as appropriate
I know Dojo 2 is still in beta and documentation is still in progress, but from what I gather:
- there is no parser, the Dojo 2 approach is to generate custom elements
- modules are bundled by default and lazy loading requires explicit declaration
- A non-widget module can no longer be loaded declaratively
- To use a custom element imperatively, one should simply generate a DOM node of the correct type
Questions that arise:
- I presume I would then need to use the webcomponents.org polyfill?
- If I have one module that generates a custom element that is used inside of another module which is not a custom element (attached via the projector), then the dependency between the two is not managed?
- These things, combined with concerns that web components aren’t ready yet lead me to think I would prefer to use the projector method if I can. However, I would probably need to use it with multiple roots and consequently I would basically need to re-implement something like the Dojo 1 parser. Am I missing something?
If anyone has any guidance that would help me sort out these issues, I would greatly appreciate it. If the answer is that time and documentation will answer these questions, that’s fine too. I just want to make sure I’m prepared for the transition.