Matthew Dean
809f1b1862
Merge pull request #2735 from less/browser-cache
...
Fix for #2384 and caching enabled with modifyVars set
2016-01-26 09:54:39 -08:00
Marko Pukari
c731fe0dc1
Fail when image-size functions are used in browser-less.
2015-11-27 13:20:07 +02:00
Matthew Dean
65404cb506
Allows stylesheets to cache even with modifyVars
...
- Basically, compares assigned vars to vars in localStorage. If they match (and all the other cache criteria pass), then loads from cache
2015-11-25 22:53:36 -08:00
Christian Hammond
f66757554f
Fix synchronously loading/applying stylesheets on page load.
...
Starting in 2.0, stylesheet loading became asynchronous, through the
usage of promises for both calculating the list of stylesheets and the
initial call to less.refresh(). This resulted in visual issues while
loading on some browsers (noticed in Firefox and Safari), along with
breakages of any custom JavaScript that depended on the computed style
of elements on the page, due to race conditions.
This change preserves the promise for initial page loading, in order to
retain support for less.pageLoadFinished, but immediately executes the
stylesheet scan (through a new less.registerStylesheetsImmediately
function) and the less.refresh() call. That resulting behavior matches
versions of less prior to 2.0.
This unveiled a regression in registering functions, both in the browser
and in unit tests, that was not previously noticed due to the
asynchronous load. Registered functions would have a 'less' variable set
to the less options, and not less itself, when not going through the
asynchronous loading mode. This meant that both unit tests and
real-world function registration would break when the sync page loading
was fixed. Overriding window.less to point to the actual less module and
not less.options during bootstrap fixes this.
This fixes #2317 .
2015-04-28 02:08:39 -07:00
Bass Jobsen
296014a632
add more plugin tests
2015-03-03 22:52:54 +01:00
Luke Page
604c911441
style cop 2 - indentation
2015-01-30 20:41:25 +00:00
Luke Page
1494e25ef0
More style cop..
2015-01-30 18:28:02 +00:00
Luke Page
31c3d04980
jscs style checking. Fixed whitespace issues.
2015-01-26 23:34:35 +00:00
Luke Page
43773dd550
Pass the css from the cache into the callback. Fixes #2381
2015-01-12 19:39:51 +00:00
Luke Page
9e279a69d8
Some simplification in the browser and do not cache if modify vars is se. Fixes #2054
2015-01-04 08:11:48 +00:00
Luke Page
b51691ccee
missing return statement causing failing tests
2014-11-22 18:46:02 +00:00
Luke Page
89c95af070
Fix isSync option, turn browser back to running sychronously and fix many issues that came up
2014-11-22 18:30:36 +00:00
Luke Page
9ddd81fc07
seperate out bootstrapping less and the browser api
2014-11-01 17:05:21 +00:00
Luke Page
d48fd51661
change default for useFileCache. Fixes #2261
2014-11-01 14:30:29 +00:00
Luke Page
062afacfe0
Fix browserify to be the one to expose less to window
2014-11-01 12:04:54 +00:00
Moez Bouhlel
815e977b0b
add support to read options from less file link tag data attr
2014-10-22 19:20:20 +01:00
Moez Bouhlel
0681e59d3d
improve support to read options from script tag data attr
2014-10-22 18:00:33 +01:00
Moez Bouhlel
e5b18c08ce
add support to read options from script tag data attr
2014-10-22 16:08:38 +01:00
Luke Page
d436b83c06
put the built-in cache on the less object
2014-10-19 18:42:07 +01:00
Luke Page
845ec72131
improve error reporting
2014-10-19 16:48:04 +01:00
Luke Page
114d3e59e8
Tidy up after solving problem when building in linux
2014-10-19 09:47:39 +01:00
Luke Page
545ee85a25
travis CI test 3
2014-10-19 08:44:56 +01:00
Luke Page
7b84a9fe54
another travis ci test
2014-10-19 08:40:14 +01:00
Luke Page
6913f305b5
Test why travis CI is failing
2014-10-19 08:34:49 +01:00
Luke Page
5796cf29e0
upgrade browserify. Use the promise shim instead of the full node version in the browser.
2014-10-18 08:34:54 +01:00
Luke Page
8b42ae3883
A few tweaks to browser loading
2014-10-17 08:12:52 +01:00
Luke Page
659bf74777
Merge pull request #2233 from levithomason/feature/reload-stylesheets
...
Method to scan for and register stylesheets
2014-10-17 08:02:21 +01:00
Levi Thomason
0e821f1a4f
cleanup callback
2014-10-15 23:03:55 -07:00
Levi Thomason
89358faefe
more sane resolve
2014-10-15 23:02:11 -07:00
Levi Thomason
d31be578a3
Fixes #713 , #771 , #1161
2014-10-15 22:58:15 -07:00
Levi Thomason
999af91bb3
set less.hasFinished to refresh() promise
...
fix white space
return promise on modifyVars
2014-10-14 00:30:35 -07:00
Levi Thomason
a0b1b2f4bd
refresh returns promise
...
pass the error to reject()
2014-10-12 17:28:03 -07:00
Luke Page
b966cf1d1b
some renames, tidy ups and bugfixes whilst adding npm plugin
2014-10-11 17:51:08 +01:00
Luke Page
a344240423
Remove unused warn function (replaced with logger) and allow null environments
2014-10-09 17:48:56 +01:00
Luke Page
3450e336b8
Seperate out the browser cache
2014-10-07 23:20:47 +01:00
Luke Page
cd0cf0e243
Seperate browser a bit more
2014-10-07 21:47:35 +01:00
Luke Page
91025dbe7e
move browser log code out to log listener and remove option I added temporarily that wasn't an opiption
2014-10-07 21:05:26 +01:00
Luke Page
9be165ba8a
Fix tests by adding logger to record messages in test common js
2014-10-07 07:42:35 +01:00
Luke Page
8d431179e5
Add logger
2014-10-05 20:36:23 +01:00
Luke Page
dedf0eee38
rename env to context to avoid confusion with environment
2014-10-05 18:50:34 +01:00
Luke Page
3af09233b1
Fix final weird error - in phantom only some console.log calls are going missing?
2014-10-05 10:42:38 +01:00
Luke Page
70bf802b2c
Fix the main browser tests
2014-10-04 18:04:50 +01:00
Luke Page
7a6b1e278b
Pull out the file manager aspect of the environment so new file managers can be added dynamically
2014-10-04 17:46:30 +01:00
Luke Page
823ab221dd
further simplifications to the parse context
2014-09-22 21:24:48 +01:00
Luke Page
ff72e24ba5
Fix browser if no less object specified
2014-09-22 20:31:25 +01:00
Luke Page
fb6c879cc4
remove env from all environment calls except the ones that actually need it
2014-09-21 16:46:44 +01:00
Luke Page
e172602938
change render and tree to return an object containing css and map and in the future possibly other things
2014-09-20 00:29:05 +01:00
Luke Page
1a78cd5901
Remove unnecessary text from require statements
2014-09-08 00:57:50 +01:00
Luke Page
d9c42e206d
seperate out the environments at the top-most-level
2014-09-04 19:11:59 +01:00