my personal w̶e̶b̶s̶i̶t̶e̶ npm module.
Here's how you install and run the module
npx amilajack
Run this if you would like to have the module installed globally
npm install -g amilajack
A browser API compatibility database
License: MIT License
Create tests that instantiate new objects and run some type introspection on those new objects to determine compatibility.
Helps avoid the following errors:
The SVGElement.ondurationchange getter can only be used on instances of SVGElement
See this
docker machine has been deprecated
See this
display: 'block'
^ property ^ value
fetch()
^ function
Array.prototype.length
^ number
JS should determine: string, function, object, array, null
CSS should determine: property, value
IE tests were disabled due to issues with saucelabs. Make sure to reenable the tests
write e2e tests that mock saucelabs. assert that the algorithm halts, assert TmpDatabase
is empty, assert JobQueue
is empty, and expected records exist
Upon running npm run build-compat-db
, no records are inserted into tmp-records.
Solutions:
build-compat-db
@types/x
definitions for dependenciesMay involve recursively traversing JS's type system and manually constructing protoChainId
s
A leading cause of test failure on sauce labs is because our tests are too large in size. Limiting our tests batches to a couple hundred solves this issue but limits our performance. Migrating from statically generated tests to a more dynamic solution can solve this. This will fix tests on safari, which seem to fail on almost every test execution batch
Some tests can only be run in certain contexts. WebGL and Workers are examples of this. We currently do some primitive prototype lookups to check if an API is defined in the global context. For other contexts, we'll need to make some modifications:
example:
// Try this in chrome, which has support for webgl:
WebGLRenderingContext.clearColor === undefined // true
// We need to do this instead:
const canvas = document.getElementById('glCanvas');
var webglContext = canvas.getContext('webgl')
webglContext.clearColor === undefined // false
We need some way of checking all the records in the TmpRecordDatabase
.
We need to check:
The logic for this should be added under ./src/helpers/RecordsValidator
. I recommend using the the RecordType
(which should be renamed to RecordsType). It describes the typing information of the records.
Parsing webidl definititions and using them to determine the metadata of the API's can be very useful. That means we dont have to run tests to detect the metadata.
WebIDL sources: https://dxr.mozilla.org/mozilla-central/source/dom/webidl
Autogenerate tests for a given webidl definition:
Convert webidl defs to flow defs
We need to expose some kind of API wrapper around all.json
. Users should be able to query it like so:
CompatDB.search({
type: 'js',
protoChainId: 'Array.push'
})
// Should return `DatabaseRecordType`
For each API in browser-compat-data, find what type of API ASTNodeType
it is. Run tests in nigthmare to determine the node types
The PR for this is responsible for writing the actual databases to be consumed by users. The database should implement src/DatabaseType.js
.
The database should be split into separate modules. This will allow for better traversal performance. The databases will be split into css.json
, js.json
and all.json
.
This has been something I've been planning on doing for a while. The reasoning for this mostly stems from better tooling around the typescript community. Future contributors are also probably more familiar with TypeScript than flow because of the greater adoption of TS.
Initially we were only using one database table, which was responsible for storing records. TmpDatabase
was initially written as a collection of pure functions that all interaction with the database without side effects. As the project architecture changed to allow for better optimizations, we added a new 'jobs' table which is responsible for handling the JobQueue. It is likely that in the future more tables and databases will be added. With this in mind, I created an AbstractDatabase
class which is intended to be extended by future database API's.
We need to implement a replacement for TmpDatabase which extends the AbstractDatabase
. See the JobQueueDatabase
implementation for an example. Here's some requirements for the PR:
TmpDatabase
module. Just create a new TmpRecordDatabase
moduleTmpRecordDatabase
We can reach browser parity with caniuse by supporting mobile browsers. This can be done by adding the name mappings and browserName
and version
's to src/helpers/Constants.js
.
Ideally, compat-db
will feature all, if not more, of the browsers supported by caniuse
Determine if an API is supported in a certain browser. The CSS.supports()
api can suffice in many cases but what if the browser doesn't even support CSS.supports()
?
We need a function that can determine if a css property
function determineCSSRuleCompat(property: string, value: string): bool {
// We need a CSS.supports() polyfill in case browser doesn't support the CSS.supports()
// See this: https://github.com/termi/CSS.supports
}
We also need to find all the possible supported CSS rule values.
function getAllCSSPropertyValues(property: string): Array<string> {
// Return all supported css property values
}
For example, getAllCSSPropertyValues('display')
would return ['flex', 'block', 'inline', ...etc]
. This will probably requiring reverse-engineering this polyfill.
compat-db
has become a pretty large project. I found it useful to split the project into smaller projects. I have created a new project called ast-node-type-verifier
. This new project takes the responsibility of inferring metadata about API's (specifically the ast node types of API's). The responsibility of compat-db
will shift to focus solely on testing the compatibility of certain API's.
Building the compatibility database is limited by how fast we remove finished jobs. Batching a single remove query would significantly improve performance.
An example is Array.toString
and Array.prototype.toString
. This api is currently determined to be static.
On registry https://registry.npmjs.org/
, the "latest" version (v6.24.1) of dependency babel-preset-es2015
has the following deprecation notice:
🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.
Please take the actions necessary to rename or substitute this deprecated package and commit to your base branch. If you wish to ignore this deprecation warning and continue using babel-preset-es2015
as-is, please add it to your ignoreDeps array in Renovate config before closing this issue, otherwise another issue will be recreated the next time Renovate runs.
Affected package file(s): package.json
Appium is a basically the 'mobile version' of selenium. It runs tests on mobile browsers.
http://webdriver.io/guide/services/appium.html
Appium is supported by saucelabs so we don't need to create an new accounts 😊 We need to run the selenium tests on appium to get mobile coverage.
window.CSSStyleDeclaration.overflowX
is not defined in safari, yet it supports the css property overflow-x: ''
CSS property. We need to write some functionality that subsequently uses the CSS compat records to update the JS records.
There are a number of API's that marked as unsupported because the protoChain
parsed from APICatalogue is of the WebIDL definition. Here's an example of the inconsistency:
// returned from APICatalogue:
protoChain: ['window', 'Window', 'requestAnimationFrame']
// Expected:
protoChain: ['window', 'requestAnimationFrame']
We should also consider dropping the default 'window.*' prefix
Configure travis to npm run build-compat-db
and publish the npm package. Requires using env variables
This issue provides visibility into Renovate updates and their statuses. Learn more
These updates are awaiting their schedule. Click on a checkbox to get an update now.
babel-jest
, expect
, jest-cli
)babel-jest
, expect
, jest-cli
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@babel/cli
, @babel/core
, @babel/node
, @babel/plugin-proposal-class-properties
, @babel/plugin-proposal-decorators
, @babel/plugin-proposal-do-expressions
, @babel/plugin-proposal-export-default-from
, @babel/plugin-proposal-export-namespace-from
, @babel/plugin-proposal-function-bind
, @babel/plugin-proposal-function-sent
, @babel/plugin-proposal-json-strings
, @babel/plugin-proposal-logical-assignment-operators
, @babel/plugin-proposal-nullish-coalescing-operator
, @babel/plugin-proposal-numeric-separator
, @babel/plugin-proposal-optional-chaining
, @babel/plugin-proposal-pipeline-operator
, @babel/plugin-proposal-throw-expressions
, @babel/plugin-syntax-dynamic-import
, @babel/plugin-syntax-import-meta
, @babel/plugin-transform-flow-strip-types
, @babel/plugin-transform-modules-umd
, @babel/plugin-transform-runtime
, @babel/polyfill
, @babel/preset-env
, @babel/preset-flow
, @babel/register
, babel-eslint
, babel-loader
)Provide examples of how someone can use the compat-db API
Ensure that each record maps to a local WebIDL definition
Developer preview browsers (Safari Technology Preview, Chrome Canary, FirefixNightly, etc) have support for far more API's than regular browsers. Testing against them will allow us to determine the metadata of a significantly larger number of API's (namely, the APIs that are experimental). We'll need to use selenium to target local browser installations.
This will require migrating from nightmare to selenium
process.on('unhandledRejection', err => {
throw err;
});
The tests (which can be run with npm run spec
) should be able to run on SauceLabs' servers. This is the initial step for us to retrieving the coverage from tests across all browsers. Lets try to have the tests running on at least chrome, firefox, safari, and edge.
Here is a related tutorial that I found which will help with configuring webdriverio tests to run on saucelabs.
Currently, webdriverio runs synchronously. For example, if we use browser.execute()
inside of a for-loop, we cant move to the next iteration until browser.exexute()
finishes. Enabling async tests will allow this. webdriverio has support for this. This will require using async/await and chaning the wdio.conf.js
.
Another performance enhancement would include enabling concurrent processes. At the moment, webdriverio processes are limited to a maximum of 40. We can increase this but that means we can't write to shared memory so we can avoid race conditions. This can be solved by having each browser have its own in-memory storage. Once all the tests for all the browsers are done, the in-memory storages of all the browser tests can be merged into the compiled database (./lib/all.json
)
Currently we can complete tests at a rate of 120 tests per minute. We have a total of 14000 tests so that'll take around 2 hours to finish.
This should be done in the formatCSSAssertion()
and formatJSAssertion()
fn's. Try to convert the hasPrefix()
method to a string (hasPrefix.toString()
) and include it in those methods. Also remember to add the test cases for this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.