visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Clojure compiler warning #444

Closed vagran closed 6 years ago

vagran commented 6 years ago

When compiling JS which uses page.js it has the following annoying warning:

node_modules/page/page.js:1: WARNING - Suspicious code. The result of the 'not' operator is not being used.
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.page=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

Would be cool to replace "!function(...){..}(...)" by "(function(...){...})(...)".

matthewp commented 6 years ago

Thanks! I wonder if switching to something like rollup instead of browserify would fix this.

paulocoghi commented 6 years ago

Yep. Using Rollup fix this. I use it.

matthewp commented 6 years ago

I just wonder if this is considered a "breaking change" or not. Can't think of a reason why it would be...

paulocoghi commented 6 years ago

For me, I only consider that it's a "breaking change" when it implies changes in end use.

If the way developers use the library does not change, changing the way the maintainers develop it is not considered a "breaking change", IMHO.