Closed rjcorwin closed 7 years ago
We should take a deep look at Ionic. It seems to be very well supported soup to nuts framework using a lot of the same ingredients we are looking to brew together. The catch with Ionic might be is that the Angular team might be making tools that could soon dwarf Ionic's tooling. For example, Ionic's CLI vs the new officially supported Angular CLI.
From Ionic's v2.0.0 announcement on Jan 25, 2017:
Ionic 2.0 final is hardly the end of Ionic’s development. Coming next we are working on new features to add proper desktop and electron support, something we’ve dipped our toes into in the past but will be making a bigger priority going forward. Similarly, we will be ramping up our Progressive Web App efforts to enable Ionic developers to deploy the same app with the same code across the app stores and the mobile web to take advantage of those diverse channels.
An Angular server is coming in Angular 4. This is pushing the best practice of having your frontend served on a frontend server with a separate backend service. It puts the pressure on us to write separate Dockerfile's for frontend and backend while strapping it together with a Docker Compose file. The original motivation was to improve build times.
Links to good sites for this discussion.docx
The above document has some great links for this discussion.
Ionic brings a lot to the table. Here's a couple notes thinking about those things and comparing them to other things.
page-
.I been thinking about what the Unique Selling Proposition (USP) of Ionic is. Last year I think it went as follows...
Today I have have reservations about those USPs.
On the first USP, Angular now has supported Angular CLI which provides the best practices for starting an Angular Application, building it, mind blowing generators, test harness, and amazing upgrade path tools. Going with Ionic means we don't get to use Angular CLI (for now, maybe in the future). Ionic has their own opinions about how an app should be structured, for example they don't use the Angular Router. The one thing that Ionic CLI has over Angular CLI is that Ionic CLI can build to APK out of the box. Building to APK after a Angular CLI build requires setting up Cordova yourself.
On the second USP, Ionic Components are cool, but Angular Material is equally if not even more cool than Ionic Components (https://material.angularjs.org/). There seems to be a real solid commitment to Angular Material, some great best practices (like using wrapper elements over native tags), and it works great on both Desktop format, Tablet, and mobile. While Ionic Components are now also targeting the Desktop format, I'm not sure they are going to as good of a job of making a UI library that work well on both Mobile and Desktop as the Google has done with Material.
A note on installing Material, angular-cli
has its own doc page for installing Material. The thing I think that page does differently than the standard Material docs is that it imports all of the Material components with one require. That's probably just going to result in a dist size that is much larger than necessary.
Angular Material has been added to our client-v3 codebase with this commit https://github.com/Tangerine-Community/Tangerine/commit/d0d2a1a30c4f87ad71521e1eb40fe831d55afb88
Researching databases and auth...
this.http.post('http://localhost:3000/auth/login'...
Modular Router is now in client-v3
.
Updated this ticket's summary with the following and some more things to do.
Code: https://github.com/Tangerine-Community/Tangerine/tree/v3.x.x/client-v3
For reference, the [i18n] plans for v4 and beyond issue. Olivier mentions "looking at possible solutions, using an external file is one of them." Which would I think make it easier for us to serve the use case of needing to update translations quickly without having to wait for another release of Tangerine.
How do we do Lazy Loading of Dynamic Translation tables
Caching: Reducing Load Times by caching the translation files. Could this help when using JIT?
Embedding in cordova? When we use AOT, will we Create a separate app for each language? Or include all languages? Leads to bloating of app. Github issue.
Separate app for each language leads to UX issues- no dynamic language change, requires complete site reload.
JIT loads translations at bootstrap which is not the same as switching at runtime. Switching languages will mean re-bootstrapping the the app. We can save the user's progress in local storage perhaps so as not to lose changes made by the user. Actually, we could do progressive saving of the user's state as the user makes changes across the app and not only to deal with i18n.
The UI language ideally should'nt be a compiler issue. The text should be able to be loaded at runtime through a module library that can be loaded and used like any other. This will be changed in the future though there is no concrete timeline
Breaking change planned around autogeneration of IDs- the method will change and the IDs will ot match anymore. There will be a cli migration tool to help update translation files.
For large apps, having a single translation file for each language could affect load times. Probably a good idea to break translation file into smaller files
ng2-translate will be deprecated once i18n in implementation reaches feature parity. It is a minimal way to translate app. The angular i18n is the one suited for enterprise
Translation for messages embedded in code? e.g throw new Error('Message that should be translated')
One approach is this. This only works for JIT.
ngx-translate has poor performance when compared to using Angular's i18n as i18n doesn't use bindings. As the number of translations multiply, the more the perfomance gain
You need to pay attention on the location of your i18n directive, it should be placed directly on the element that contains the text, not on any other siblings. example
Library support may be included in v5. Release date is 2017‑09‑18. Link
using user agent is tricky e.g. in canada or in situations where the user understands a different language
An example implementation of the translation in production app is here
Demo for showing the use of one app per language.
Other Links
My current directions for starting Test Driven Development on a Component by Component basis.
it
function to using fit
function.ng test
.DEBUG
.Also see https://aio-staging.firebaseapp.com/guide/testing#import-the-feature-module for examples of things like fixture.debugElement.query(By.css('input')).nativeElement
.
Here's an example of a more advanced Component Spec where we feed it data and then check to make sure that the DOM of the component is as expected https://github.com/Tangerine-Community/Tangerine/blob/v3.x.x--tangerine-forms/client-v3/src/app/tangerine-forms/tangerine-page/tangerine-page.component.spec.ts
@evansdianga The test spec for Tangerine Page Component now simulates adding input to a form, submitting it, and then makes sure that corresponding @Output
matches what we would expect. There is a click
function used that is taken directly from the docs and requires passing in the "nativeElement" I think. We're getting closer to the level of testing complexity we want but still have things to learn from https://aio-staging.firebaseapp.com/guide/testing.
@rjsteinert Angular documentation currently points towards using SystemJS as a module loader. This is especially true for the documentation on i18n. Our configuration uses Webpack. Digging through the various configuration options, docs for Webpack is missing not only for the i18n but for most parts of Angular. Check this open issue for details. https://github.com/angular/angular.io/issues/3163 Another option with Webpack is to use this method. https://medium.com/@feloy/deploying-an-i18n-angular-app-with-angular-cli-fc788f17e358 Integrating this configuration into our app may solve the issue. Any thoughts?
@evansdianga That blog post looks helpful. To supplement that post, the angular-cli wiki might have more up to date information. Keeping an eye on this search result might help https://github.com/angular/angular-cli/search?q=i18n&type=Wikis&utf8=%E2%9C%93
The pages relevant to use I think are these.
I added documentation on how to do TDD with Angular Units Tests when creating Components https://github.com/Tangerine-Community/Tangerine/blob/v3.x.x/docs/how-to-create-a-new-component.md.
I also got Travis CI working correctly thanks to @chrisekelley https://travis-ci.org/Tangerine-Community/Tangerine/builds/240416270
I also started setting up Greenskeeper.io so it will send us pull requests when we have a package that needs updating. I integrated it with the Tangerine repository but I can't seem to find a way to show that the package.json it needs to care about lives at client-v3/package.json
.
Code: https://github.com/Tangerine-Community/Tangerine/tree/v3.x.x/client-v3
Related User Stories
To do
/client-v3/index.html
when a Tangerine container is running.