Skip to content

Feature/rewrite urls - #3248

Merged
matthew-dean merged 23 commits into
masterfrom
feature/rewrite-urls
Jul 18, 2018
Merged

matthew-dean merged 23 commits into
masterfrom
feature/rewrite-urls

Conversation

@matthew-dean

@matthew-dean matthew-dean commented Jun 30, 2018 •

Copy link
Copy Markdown
Member

Moved from #3041

@matthew-dean

Copy link
Copy Markdown
Member Author

I closed this and re-opened a PR with fixed tests. See: #3248.

Are there any error cases missing? Can rewrite URLs cause an error?

If this looks good, we can merge. Thanks @jhnns!

@calvinjuarez

calvinjuarez commented Jul 7, 2018 •

Copy link
Copy Markdown
Member

Tests failing. The failure is the same as some other PRs.

jasmine:rootpathRewriteUrls
[secure].js browser test - rootpath and rewrite urls
   - original-[secure]:test-[secure]-urls should match the expected output......X
     ReferenceError: Can't find variable: Promise in http://localhost:8081/test/browser/common.js (line 252) (1)

@matthew-dean

Copy link
Copy Markdown
Member Author

@calvinjuarez I think this is something wrong with our tests rather than the PR, since it happens everywhere and also happens randomly (and doesn't happen for Appveyor). Maybe some polyfill is loading asynchronously in Node 9 for PhantomJS?

@matthew-dean

Copy link
Copy Markdown
Member Author

This should probably wait until #3274 is merged and then do the "options upgrade" the same way.

calvinjuarez and others added 3 commits July 11, 2018 14:32
* WIP - Added strictMath: 'division' option

* Removes `less-rhino` (broken for a long time) - Fixes #3241

* Expressions require a delimiter of some kind in mixin args

* Removes "double paren" issue for boolean / if function

* WIP each() re-implementation

* Allows plain conditions without parentheses

* Added each() and tests

* Added tests calling mixins from each()

* Fixes #1880 - Adds two new math modes and deprecates strictMath

* Allows named args for detached ruleset (anonymous mixin)

* Makes sure this doesn't regress needing parens around mixin guard conditions

* Remove javascriptEnabled from browser options check, add to defaults

* Workaround weird Jasmine conversion of < to HTML entity

* Removes remaining Rhino cruft

* Remove rhino files from bower

* Bump Jasmine version

* Added .() example to each

* v3.6.0

* Update CHANGELOG.md

* add explicit nested anonymous mixin test

* add explicit nested anonymous mixin test result

* derp: align test with expected output

* v3.7.0 (#3279)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
# Conflicts:
#	bin/lessc
#	lib/less-browser/add-default-options.js
#	lib/less-node/lessc-helper.js
#	lib/less/parse.js
#	test/index.js
#	test/less/math/parens-division/parens.less
#	test/less/math/strict/parens.less
#	test/less/strict-math/parens.less
@matthew-dean

Copy link
Copy Markdown
Member Author

I redid this branch to use the same "upgrade" pattern as the strictMath-to-math upgrade pattern.

That is, any options sent to parse() or render() are translated from string values to constants. I'm not sure it'll make a huge difference in evaluation time, but string comparisons during evaluation for options seemed unnecessary. Ideally all options would be either integer checks or booleans.

@matthew-dean

Copy link
Copy Markdown
Member Author

@less/core

Since I don't have a firm grasp of this feature, I think it the tests should be reviewed by @jhnns and others before this is merged to see if the input/output is intuitive and as expected. I didn't really verify the feature; I just got it working / synced with master.

@calvinjuarez calvinjuarez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm fully qualified to pass this one off, since I haven't been following the issue, but I'll work my way through the code. For now, just a couple questions/thoughts.

We could add tests for the deprecation warning to the Grunt opts test.

Gruntfile.js @ ln. 204

'node bin/lessc --relative-urls test/less/lazy-eval.less tmp/lazy-eval.css',

Comment thread bin/lessc
os = require('os'),
utils = require('../lib/less/utils'),
MATH = require('../lib/less/math-constants'),
Constants = require('../lib/less/constants'),

This comment was marked as resolved.

Comment thread bin/lessc Outdated
case 'ru':
case 'relative-urls':
options.relativeUrls = true;
console.warn('The relative-urls option has been replaced by the rewrite-urls option and will be removed.');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rephrasing to match other deprecation warnings?

The --relative-urls option has been deprecated. Use --rewrite-urls=all.

(I'm not entirely sure which rewrite-urls corresponds to relative-urls.)

@jhnns

jhnns commented Jul 18, 2018

Copy link
Copy Markdown
Contributor

Looks good to me 👍 :)

@matthew-dean

Copy link
Copy Markdown
Member Author

Thanks @jhnns!

@matthew-dean
matthew-dean merged commit 2d43c0b into master Jul 18, 2018
@matthew-dean

Copy link
Copy Markdown
Member Author

@jhnns

jhnns commented Sep 30, 2018

Copy link
Copy Markdown
Contributor

Sure, I can do that :)

jhnns added a commit to jhnns/less-docs that referenced this pull request Sep 30, 2018
@jhnns

jhnns commented Sep 30, 2018

Copy link
Copy Markdown
Contributor

@iChenLei
iChenLei deleted the feature/rewrite-urls branch July 20, 2021 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants