Skip to content

Commit

Permalink
better mapping for edge and fix pages (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke authored Jan 14, 2023
1 parent 8257e98 commit b52632d
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: cache core-web-tests
id: cache-core-web-tests
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
path: packages/core-web-tests/dist
key: cache--core-web-tests--${{ env.commit-sha }}
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/core-web-generator/lib/generate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core-web-generator/lib/generate.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions packages/core-web-generator/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,15 @@ async function gen(feature: string, mapping: Array<Feature>, aliases: Array<Feat
version = version.trim();

if ((browser === 'edge' || browser === 'edge_mob') && version === '*') {
version = '<79'
if (meta.browsers['chrome'] && semver.satisfies('79.0.0', meta.browsers['chrome'])) {
version = meta.browsers['chrome']
} else {
version = '<79';
}
}

if (browser === 'android' && version === '*') {
version = '<4.4'
version = '<4.4';
}

// Must parse as a semver range.
Expand Down
2 changes: 1 addition & 1 deletion packages/core-web/__mapping.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core-web/lib/__mapping.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core-web/lib/__mapping.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions packages/pages/lib/browser-compat/templates/polyfill-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const cssTags = require('../../css/to-html');
const siteFooter = require('../../landing/templates/site-footer');
const path = require('path');
const { dotsWBR, dotsZeroWidthSpace } = require('./dots-wbr');
const he = require('he');

module.exports = function polyfillCardHTML(assetMap, feature, sitemap) {
return html`<!DOCTYPE html>
Expand Down Expand Up @@ -213,15 +214,15 @@ function notes(feature) {
list = feature.polyfillio.notes.map((note) => {
return html`
<li>
${note}
${he.encode(note)}
</li>
`;
});
} else {
list.push(
html`
<li>
${feature.polyfillio.notes}
${he.encode(feature.polyfillio.notes)}
</li>
`
)
Expand Down Expand Up @@ -298,9 +299,9 @@ function browsers(feature) {
list.push(
html`
<li>
<div style="display: flex;justify-content: space-between; max-width: 220px;">
<div style="display: flex; justify-content: space-between; max-width: 220px;">
<div>${prettyBrowser(browser)}:</div>
<div>${version}</div>
<div>${he.encode(version)}</div>
</div>
</li>
`
Expand Down
Loading

0 comments on commit b52632d

Please sign in to comment.