@nikjohn
WEB TECHNOLOGY STACK
WEB DEVELOPMENT PROCESS
WEB TEAM
Q & A
SIZES
PAYLOADS
ARCHITECTURE
FRAMEWORKS
TESTING
TRANSLATION
DEPLOYMENT
width < 128px
OR
(ua.indexOf('/midp') > -1)
Wireless Device
AND
(Proxied Browser
OR
width < 320px
OR
Pointing method != touch)
Wireless Device
AND
!XS
!Wireless Device
AND
!Legacy (e.g. IE8)
Sizes | Resolution | Wireless Device |
Special Condition |
---|---|---|---|
txt |
< 128 px |
Yes |
- ua contains ‘midp’ |
xs |
< 320 px |
Yes |
- Non-touch device - Proxy browser |
sm |
Yes |
- Not ‘xs’ |
|
lg |
No |
- Not legacy (e.g. IE8) |
mixin character-count(max)
if LG || SM
p.char-counter(data-max-chars=max)
span.current
| 0
span.divider
|/
span.max
= max
xs |
---|
sm |
---|
lg |
---|
.only-xs() |
.only-sm() |
.only-lg() |
.until-lg() |
.from-sm() |
.item-detail.is-job {
.item-intro {
text-align: left;
}
.until-lg({
.item-intro {
padding-bottom: 1em;
border-bottom: solid 1px @color-linnen-grey;
}
});
}
BROWSER
MIDDLEWARE (NODE JS + EXPRESS JS)
API
http(s)
http(s)
BROWSER
MIDDLEWARE (NODE JS + EXPRESS JS)
API
http://bikroy.com/EN/ads/ads-in-bangladesh
GET http://api.bikroy.com/v1/serp
GET http://bikroy.com/EN/ads/ads-in-bangladesh
*Google supports crawling of JS-based applications, but recommends progressive enhancement still.
&
txt |
---|
xs |
---|
sm |
---|
lg |
---|
NODE JS (4.x)
NODE JS (4.x)
EXPRESS JS (4.x)
BACKBONE JS MODELS
PUG (JADE) TEMPLATES
BACKBONE VIEWS *
ZEPTO JS
* Admin uses a slimmer PoC as well - Furiosa
* No dependency in any direction between Backbone views and models
SERVER
CLIENT
var helpers = require('../../helpers/unit'),
images = require(helpers.base + 'server/middleware/images');
suite('server/middleware/images', function() {
test('images sm, jpg', function(done) {
var request = {
},
response = {
locals: {
platform: 'lg'
}
};
images(request, response, function() {
assert.equal(response.locals.sizes.full.length, 2);
assert.ok(response.locals.sizes.full[0].indexOf('.jpg') > -1,
'image size has .jpg format');
done();
});
});
test('images sm, webp', function(done) {
var request = {
headers: {
accept: 'text/html;q=0.9,image/webp,*/*;q=0.8'
}
},
response = {
locals: {
platform: 'sm'
}
};
images(request, response, function() {
assert.equal(response.locals.sizes['list-normal'].length, 2);
assert.ok(response.locals.sizes['list-normal'][0].indexOf('.webp') > -1,
'image size has .webp format');
done();
});
});
});
Loads a page for a certain market and locale, then runs commands to manipulate and assert application state. (~4k assertions in entire suite)
var helpers = require('../../helpers/functional');
module.exports = helpers.runAllSites({
landing: function(market, locale) {
var test = function(client) {
var locales = helpers.markets[market].locales,
countrySlug = helpers.markets[market].countrySlug,
countryName = helpers.t('site.country', market, locale),
expected;
client.start('', market, locale)
.shootAll(2)
.assert.gtm({
platform: 'lg'
});
if (locales.length > 1) {
if (market === 'bikroy') {
expected = (locale === 'en' ? 'bn' : 'en');
}
else if (market === 'ikman') {
expected = (locale === 'en' ? 'si' : 'en');
}
client
.assert.elementPresent('.ui-nav .locales')
.assert.elementPresent('.locales li:nth-child(5n+' + (locales.length - 1) + ')')
.getAttribute('.locales li:nth-child(5n+1) a', 'href', function(result) {
this.assert.ok(result.value.indexOf('/' + expected) > -1,
'Locale link URL');
});
}
else {
client.assert.elementNotPresent('.ui-nav .locales');
}
if (locale === helpers.markets[market].localeDefault) {
client
.assert.attributeMatches('link[rel="canonical"]', 'href',
new RegExp('http:\/\/' + market + '\\.test(:\\d+)?\/' +
locale))
.assert.attributeMatches('.ui-logo a', 'href', '/$');
}
else {
client
.assert.attributeMatches('link[rel="canonical"]', 'href',
new RegExp('http:\/\/' + market + '\\.test(:\\d+)?\/' +
locale))
.assert.attributeMatches('.ui-logo a', 'href', '/' + locale + '$');
}
client
.assert.elementPresent('link[rel="prefetch"]')
.assert.elementPresent('link[rel="prerender"]')
.assert.translation('.home-top h1', 'home.top.title',
market, locale, {
country: countryName
})
.assert.elementsCount('.home-locations .home-group', 2)
.assert.elementsCount('.home-locations .home-group.is-city ul', 2)
.assert.elementsCount('.home-locations .home-group.is-region ul', 1)
.assert.elementPresent('.home-focus')
.assert.elementPresent('.home-safety')
.assert.elementPresent('.home-fb')
.assert.elementPresent('.home-categories')
.assert.elementsCount('.home-categories .col-12', 7)
.assert.attributeMatches('.home-categories .col-12:first-child a', 'href',
'/ads/food-agriculture-in-' + countrySlug + '-47')
.assert.containsText('.home-categories .col-12:first-child .count', '54,234');
if (helpers.markets[market].news) {
client
.assert.elementPresent('.home-news')
.assert.elementsCount('.home-news li', 2);
}
client.end();
};
test.apiMock = 'web/home/landing';
return test;
}
});
TO BE CONTINUED..