jnordberg / browsernizr Goto Github PK
View Code? Open in Web Editor NEWModernizr require wrapper for use with browserify
Modernizr require wrapper for use with browserify
Drop the regex hacks and use something like
Error: Cannot find module './../../lib/test/css/supports' from '[...]/node_modules/browsernizr/test/css'
at [...]/node_modules/resolve/lib/async.js:55:21
at load ([...]/node_modules/resolve/lib/async.js:69:43)
at onex ([...]/node_modules/resolve/lib/async.js:92:31)
at [...]/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:95:15)
This is happening on multiple projects of ours. Looks like it was caused by #16 and renders the project completely unusable for us!
When i try install this from npm i get 1.1.0 version
@jnordberg - looks like you're using a custom-built AMD -> CommonJS converter.
In case it proves useful - checkout @millermedeiros's nodefy project.
In file transforms3d.js line 5 causes a build failure due to a path location issue.
Error: Cannot find module './../../lib/test/css/supports' from 'C:\Users\USERNAME\git\PROJECT\node_modules\browsernizr\test\css'
PROBLEM LINE: 5: require('./../../lib/test/css/supports');
SOLUTION LINE 5: require('./supports');
require('./../../lib/test/video');
https://github.com/jnordberg/browsernizr/blob/master/test/video/autoplay.js#L5
should be
require('./../../test/video');
When running ./bin/build
I get:
env: coffee: No such file or directory
Is there another devDependency that I'm missing or isn't included in package.json
?
Hi @jnordberg, for my needs I’ve started automated process of creating ESM compatible version of Modernizr. I’m seeing that you’re doing similar thing here so I was wondering do you think there is some possibility of merging our efforts?
In certain tests (strictmode.js being an example) parts of the script are being incorrectly deleted because of the regular expression in ./bin/build.
In this particular example, the original code is:
Modernizr.addTest('strictmode', (function(){'use strict'; return !this; })());
And the resulting code is:
Modernizr.addTest('strictmode', (function(){'use strict';
I boiled this down to this:
src = src.replace /(return\s+.*\s*?\}\);\s*?$|\}\);\s*?$)/, ''
https://github.com/jnordberg/browsernizr/blob/master/bin/build#L12
All that being said, I'm not sure what the solution is exactly....
https://github.com/jnordberg/browsernizr/blob/master/test/css/filters.js
var testAllProps = require('./../../lib/prefixes.js');
var prefixes = require('./../../lib/testAllProps.js');
I think it has to be
var testAllProps = require('./../../lib/testAllProps.js');
var prefixes = require('./../../lib/prefixes.js');
I'm the only one who needs this test? :D
Example:
require('browsernizr/test/forms/validation');
var Modernizr = require('browsernizr');
if (!Modernizr.formvalidation) {
// do something.
}
Gives the following error:
Uncaught TypeError: undefined is not a function
The line in particular is line 24 in test/forms/validation.js
Modernizr.addTest('formvalidation', function() {
}
Is there any chance we can get a new pull from the current Modernizr repo? It's been a while :)
Thanks!
On line 1 of generate.js Browsernizr is importing all of lodash to use four utility functions. Is this code being put in the bundle Browsernizr creates, and if so, blaoting the end result for all users?
It would be fairly easy to just import the utilities that files is using instead. Let me know, and I'll submit a PR.
Hello @jnordberg,
Could you publish browsernizr again on NPM registry so that https://www.npmjs.com/package/browsernizr has the link to this GitHub repository please?
This is related to #10.
Thanks!
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.