Skip to content

Add Dojo 2 as a Preset Template fixes #447 - #665

Closed
nicknisi wants to merge 5 commits into
codesandbox:masterfrom
nicknisi:dojo-template
Closed

nicknisi wants to merge 5 commits into
codesandbox:masterfrom
nicknisi:dojo-template

Conversation

@nicknisi

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

This PR adds a new template for Dojo 2.

What is the current behavior?
This is a new template, requested and described in #447

What is the new behavior?

Dojo 2 template

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table
  • add dojo2 template
  • add temporary project as template to load (github)
  • add type definition creation to styles transpiler
  • add dojo 2 to home page
  • add default loading of dojo template src/index.html and src/main.css

Note: This has a backend change in order to set the correct template value coming from the API. To work around this in development, I added the following line to packages/app/src/app/store/providers/Api.js:

diff --git i/packages/app/src/app/store/providers/Api.js w/packages/app/src/app/store/providers/Api.js
index 35248ccb..db410a04 100644
--- i/packages/app/src/app/store/providers/Api.js
+++ w/packages/app/src/app/store/providers/Api.js
@@ -78,6 +78,7 @@ function handleResponse(response, { shouldCamelize = true } = {}) {
     camelizedData.data.npmDependencies = response.result.data.npm_dependencies;
   }
 
+  camelizedData.data.template = '@dojo/cli-create-app';
   return camelizedData.data ? camelizedData.data : camelizedData;
 }

@CompuIves CompuIves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really well done. This is the first community template and I'm super impressed that you managed to pull this off!

Are you interested in documenting what were the difficulties with adding the template, and are you interested in writing something about this in the future in the development documentation? (Or just as a .md file in this repo). I understand if you don't have the time, this is already such a big contribution!

Could you add the specified line (camelizedData.data.template = '@dojo/cli-create-app';) for now? That way I can test it directly from staging. (http://pr665.cs.lbogdan.tk/s/github/dojo/dojo-codesandbox-template)

}

setupTranspilationListener() {
listen(({ type, code, path }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reaaaally nice! I love that we now have the power of templates to define type definitions.

let result = insertCss(id, css);
result += `\nmodule.exports=${JSON.stringify(exportTokens)};`;

dispatch({ type: 'add-extra-lib', path, code: classesToDefinition(exportTokens) });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I LOVE THIS EVEN MORE!

@nicknisi

Copy link
Copy Markdown
Contributor Author

@CompuIves Wow, thanks for the feedback! I went ahead and pushed up a commit with the API override for now so you should be able to test on staging.

I would be happy to document my learning and some of the difficulties! I'll start writing down my thoughts after work tonight.

@CompuIves CompuIves mentioned this pull request Mar 28, 2018
@CompuIves

Copy link
Copy Markdown
Contributor

I made some changes in master, I'm sorry for that! I changed how Icons are resolved to utilize better code splitting. Could you rebase your branch on master? I'm planning to merge this in next Thursday.

nicknisi added 5 commits April 2, 2018 22:20
- add dojo2 template
- add temporary project as template to load (github)
- add type definition creation to styles transpiler
- add dojo 2 to home page
- add default loading of dojo template src/index.html and src/main.css
@nicknisi

nicknisi commented Apr 3, 2018

Copy link
Copy Markdown
Contributor Author

@CompuIves I rebased off the latest master and removed DojoIcon from the dojo template. That seemed to be all I needed to do to get it to work again! Let me know if there's any other way I can help!

Also, I am still working on a write-up about adding a new template. I should have it by this weekend at the latest.

@CompuIves CompuIves mentioned this pull request Apr 8, 2018
@dylans

dylans commented Apr 20, 2018

Copy link
Copy Markdown

@CompuIves any update on when this might land? We're very close to releasing Dojo 2 and would like to mention this in the blog post announcing the Dojo 2 release. Thanks!

@CompuIves

Copy link
Copy Markdown
Contributor

@dylans I will have more time for CodeSandbox from tomorrow. So I'm either planning on releasing it today or tomorrow, sorry for the delay!

@CompuIves

Copy link
Copy Markdown
Contributor

Whoop! It's in now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants