js-routes 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +5 -2
- data/lib/js_routes.rb +127 -97
- data/lib/js_routes/version.rb +1 -1
- data/lib/routes.js +22 -19
- data/lib/routes.js.map +1 -1
- data/lib/routes.ts +24 -20
- data/spec/js_routes/rails_routes_compatibility_spec.rb +13 -3
- data/spec/support/routes.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c14ad3a055abd586066f226e79c08040e311aa8d76012983a52785acbc5ae94
|
4
|
+
data.tar.gz: 330f6f56f13d6d6c48923b201ce75e24f07a9c9adac17cb599e64de7db1d3ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21550a3ebe547e811e3fa7b3c343e5c332e9dd9f6a0bac9025a8cb29156b8c392aa57d45c556741427bd2f173dedd1ea98aa7d4fe17225c0b45f79a46eedc322
|
7
|
+
data.tar.gz: 8b89660314d650dcf1091b277b615cdb653e7cd4b89b06ec676c0ad7cdd420f725930198f9f7cfe10e123d84e6085fefddd2df701f946dfcc91826047938b320
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -12,7 +12,10 @@ require 'bundler/gem_tasks'
|
|
12
12
|
require 'rspec/core'
|
13
13
|
require 'rspec/core/rake_task'
|
14
14
|
require 'appraisal'
|
15
|
-
|
15
|
+
require 'rails/version'
|
16
|
+
if Rails.version < "6.1"
|
17
|
+
load "rails/tasks/routes.rake"
|
18
|
+
end
|
16
19
|
|
17
20
|
RSpec::Core::RakeTask.new(:spec)
|
18
21
|
|
@@ -29,6 +32,6 @@ namespace :spec do
|
|
29
32
|
draw_routes
|
30
33
|
all_routes = Rails.application.routes.routes
|
31
34
|
inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
|
32
|
-
puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new
|
35
|
+
puts inspector.format(ActionDispatch::Routing::ConsoleFormatter::Sheet.new)
|
33
36
|
end
|
34
37
|
end
|
data/lib/js_routes.rb
CHANGED
@@ -45,7 +45,6 @@ class JsRoutes
|
|
45
45
|
DOT: 8
|
46
46
|
} #:nodoc:
|
47
47
|
|
48
|
-
LAST_OPTIONS_KEY = "options".freeze #:nodoc:
|
49
48
|
FILTERED_DEFAULT_PARTS = [:controller, :action] #:nodoc:
|
50
49
|
URL_OPTIONS = [:protocol, :domain, :host, :port, :subdomain] #:nodoc:
|
51
50
|
|
@@ -170,6 +169,10 @@ class JsRoutes
|
|
170
169
|
@configuration.application
|
171
170
|
end
|
172
171
|
|
172
|
+
def json(string)
|
173
|
+
self.class.json(string)
|
174
|
+
end
|
175
|
+
|
173
176
|
def named_routes
|
174
177
|
application.routes.named_routes.to_a
|
175
178
|
end
|
@@ -195,7 +198,7 @@ class JsRoutes
|
|
195
198
|
|
196
199
|
def routes_list
|
197
200
|
named_routes.sort_by(&:first).flat_map do |_, route|
|
198
|
-
|
201
|
+
route_helpers_if_match(route) + mounted_app_routes(route)
|
199
202
|
end.compact
|
200
203
|
end
|
201
204
|
|
@@ -204,7 +207,7 @@ class JsRoutes
|
|
204
207
|
if rails_engine_app.respond_to?(:superclass) &&
|
205
208
|
rails_engine_app.superclass == Rails::Engine && !route.path.anchored
|
206
209
|
rails_engine_app.routes.named_routes.flat_map do |_, engine_route|
|
207
|
-
|
210
|
+
route_helpers_if_match(engine_route, route)
|
208
211
|
end
|
209
212
|
else
|
210
213
|
[]
|
@@ -221,122 +224,149 @@ class JsRoutes
|
|
221
224
|
end
|
222
225
|
end
|
223
226
|
|
224
|
-
def
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
227
|
+
def route_helpers_if_match(route, parent_route = nil)
|
228
|
+
JsRoute.new(@configuration, route, parent_route).helpers
|
229
|
+
end
|
230
|
+
|
231
|
+
class JsRoute #:nodoc:
|
232
|
+
attr_reader :configuration, :route, :parent_route
|
233
|
+
|
234
|
+
def initialize(configuration, route, parent_route = nil)
|
235
|
+
@configuration = configuration
|
236
|
+
@route = route
|
237
|
+
@parent_route = parent_route
|
238
|
+
end
|
239
|
+
|
240
|
+
def helpers
|
241
|
+
unless match_configuration?
|
242
|
+
[]
|
243
|
+
else
|
244
|
+
[false, true].map do |absolute|
|
245
|
+
absolute && !@configuration[:url_links] ?
|
246
|
+
nil : [ documentation, helper_name(absolute), body(absolute) ]
|
247
|
+
end
|
234
248
|
end
|
235
249
|
end
|
236
|
-
end
|
237
250
|
|
238
|
-
|
239
|
-
|
251
|
+
def body(absolute)
|
252
|
+
"__jsr.r(#{arguments(absolute).join(', ')})"
|
253
|
+
end
|
240
254
|
|
241
|
-
|
242
|
-
|
243
|
-
|
255
|
+
def arguments(absolute)
|
256
|
+
absolute ? base_arguments + [json(true)] : base_arguments
|
257
|
+
end
|
244
258
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
259
|
+
def match_configuration?
|
260
|
+
!match?(@configuration[:exclude]) && match?(@configuration[:include])
|
261
|
+
end
|
262
|
+
|
263
|
+
def base_name
|
264
|
+
@base_name ||= apply_case(parent_route&.name, route.name)
|
265
|
+
end
|
266
|
+
|
267
|
+
def parent_spec
|
268
|
+
parent_route&.path&.spec
|
269
|
+
end
|
270
|
+
|
271
|
+
def spec
|
272
|
+
route.path.spec
|
249
273
|
end
|
250
|
-
name_suffix = absolute ? :url : @configuration[:compact] ? nil : :path
|
251
|
-
name = generate_route_name(name_parts, name_suffix)
|
252
|
-
body = "__jsr.r(#{route_arguments.join(', ')})"
|
253
|
-
comment = documentation(route, parent_spec)
|
254
|
-
[ comment, name, body ]
|
255
|
-
end
|
256
274
|
|
257
|
-
|
258
|
-
|
259
|
-
|
275
|
+
def json(value)
|
276
|
+
JsRoutes.json(value)
|
277
|
+
end
|
278
|
+
|
279
|
+
def helper_name(absolute)
|
280
|
+
suffix = absolute ? :url : @configuration[:compact] ? nil : :path
|
281
|
+
suffix ? apply_case(base_name, suffix) : base_name
|
282
|
+
end
|
283
|
+
|
284
|
+
def documentation
|
285
|
+
return nil unless @configuration[:documentation]
|
286
|
+
<<-JS
|
260
287
|
/**
|
261
288
|
* Generates rails route to
|
262
|
-
* #{parent_spec}#{
|
289
|
+
* #{parent_spec}#{spec}#{documentation_params}
|
263
290
|
* @param {object | undefined} options
|
264
291
|
* @returns {string} route path
|
265
292
|
*/
|
266
293
|
JS
|
267
|
-
|
294
|
+
end
|
268
295
|
|
269
|
-
|
270
|
-
|
271
|
-
parts_table = {}
|
272
|
-
route.parts.each do |part, hash|
|
273
|
-
parts_table[part] ||= {}
|
274
|
-
if required_parts.include?(part)
|
275
|
-
# Using shortened keys to reduce js file size
|
276
|
-
parts_table[part][:r] = true
|
277
|
-
end
|
296
|
+
def required_parts
|
297
|
+
route.required_parts
|
278
298
|
end
|
279
|
-
|
280
|
-
|
281
|
-
|
299
|
+
|
300
|
+
protected
|
301
|
+
|
302
|
+
def base_arguments
|
303
|
+
return @base_arguments if defined?(@base_arguments)
|
304
|
+
parts_table = {}
|
305
|
+
route.parts.each do |part, hash|
|
282
306
|
parts_table[part] ||= {}
|
283
|
-
|
284
|
-
|
307
|
+
if required_parts.include?(part)
|
308
|
+
# Using shortened keys to reduce js file size
|
309
|
+
parts_table[part][:r] = true
|
310
|
+
end
|
311
|
+
end
|
312
|
+
route.defaults.each do |part, value|
|
313
|
+
if FILTERED_DEFAULT_PARTS.exclude?(part) &&
|
314
|
+
URL_OPTIONS.include?(part) || parts_table[part]
|
315
|
+
parts_table[part] ||= {}
|
316
|
+
# Using shortened keys to reduce js file size
|
317
|
+
parts_table[part][:d] = value
|
318
|
+
end
|
319
|
+
end
|
320
|
+
@base_arguments = [
|
321
|
+
parts_table, serialize(spec, parent_spec)
|
322
|
+
].map do |argument|
|
323
|
+
json(argument)
|
285
324
|
end
|
286
325
|
end
|
287
|
-
[
|
288
|
-
parts_table,
|
289
|
-
serialize(route.path.spec, parent_spec)
|
290
|
-
].map do |argument|
|
291
|
-
json(argument)
|
292
|
-
end
|
293
|
-
end
|
294
|
-
|
295
|
-
def generate_route_name(*parts)
|
296
|
-
apply_case(parts.compact.join('_'))
|
297
|
-
end
|
298
326
|
|
299
|
-
|
300
|
-
|
301
|
-
|
327
|
+
def documentation_params
|
328
|
+
required_parts.map do |param|
|
329
|
+
"\n * @param {any} #{apply_case(param)}"
|
330
|
+
end.join
|
331
|
+
end
|
302
332
|
|
303
|
-
|
304
|
-
|
305
|
-
|
333
|
+
def match?(matchers)
|
334
|
+
Array(matchers).any? { |regex| base_name =~ regex }
|
335
|
+
end
|
306
336
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
end
|
311
|
-
end
|
337
|
+
def apply_case(*values)
|
338
|
+
value = values.compact.map(&:to_s).join('_')
|
339
|
+
@configuration[:camel_case] ? value.camelize(:lower) : value
|
340
|
+
end
|
312
341
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
342
|
+
# This function serializes Journey route into JSON structure
|
343
|
+
# We do not use Hash for human readable serialization
|
344
|
+
# And preffer Array serialization because it is shorter.
|
345
|
+
# Routes.js file will be smaller.
|
346
|
+
def serialize(spec, parent_spec=nil)
|
347
|
+
return nil unless spec
|
348
|
+
# Rails 4 globbing requires * removal
|
349
|
+
return spec.tr(':*', '') if spec.is_a?(String)
|
350
|
+
|
351
|
+
result = serialize_spec(spec, parent_spec)
|
352
|
+
if parent_spec && result[1].is_a?(String)
|
353
|
+
result = [
|
354
|
+
# We encode node symbols as integer
|
355
|
+
# to reduce the routes.js file size
|
356
|
+
NODE_TYPES[:CAT],
|
357
|
+
serialize_spec(parent_spec),
|
358
|
+
result
|
359
|
+
]
|
360
|
+
end
|
361
|
+
result
|
362
|
+
end
|
334
363
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
364
|
+
def serialize_spec(spec, parent_spec = nil)
|
365
|
+
[
|
366
|
+
NODE_TYPES[spec.type],
|
367
|
+
serialize(spec.left, parent_spec),
|
368
|
+
spec.respond_to?(:right) ? serialize(spec.right) : nil
|
369
|
+
].compact
|
370
|
+
end
|
341
371
|
end
|
342
372
|
end
|
data/lib/js_routes/version.rb
CHANGED
data/lib/routes.js
CHANGED
@@ -124,7 +124,8 @@ RubyVariables.WRAPPER((that) => {
|
|
124
124
|
extract_options(number_of_params, args) {
|
125
125
|
const last_el = args[args.length - 1];
|
126
126
|
if ((args.length > number_of_params && last_el === 0) ||
|
127
|
-
(this.is_object(last_el) &&
|
127
|
+
(this.is_object(last_el) &&
|
128
|
+
!this.looks_like_serialized_model(last_el))) {
|
128
129
|
if (this.is_object(last_el)) {
|
129
130
|
delete last_el[this.configuration.special_options_key];
|
130
131
|
}
|
@@ -144,7 +145,7 @@ RubyVariables.WRAPPER((that) => {
|
|
144
145
|
}
|
145
146
|
path_identifier(object) {
|
146
147
|
const result = this.unwrap_path_identifier(object);
|
147
|
-
return this.is_nullable(result) ? "" : "" + result;
|
148
|
+
return this.is_nullable(result) || result === false ? "" : "" + result;
|
148
149
|
}
|
149
150
|
unwrap_path_identifier(object) {
|
150
151
|
let result = object;
|
@@ -187,14 +188,14 @@ RubyVariables.WRAPPER((that) => {
|
|
187
188
|
...default_options,
|
188
189
|
...options,
|
189
190
|
};
|
190
|
-
const
|
191
|
+
const keyword_parameters = {};
|
191
192
|
const query_parameters = {};
|
192
193
|
for (const key in options) {
|
193
194
|
if (!hasProp(options, key))
|
194
195
|
continue;
|
195
196
|
const value = options[key];
|
196
197
|
if (this.is_reserved_option(key)) {
|
197
|
-
|
198
|
+
keyword_parameters[key] = value;
|
198
199
|
}
|
199
200
|
else {
|
200
201
|
if (!this.is_nullable(value) &&
|
@@ -207,32 +208,35 @@ RubyVariables.WRAPPER((that) => {
|
|
207
208
|
let i = 0;
|
208
209
|
for (const part of route_parts) {
|
209
210
|
if (i < args.length) {
|
211
|
+
const value = args[i];
|
210
212
|
if (!hasProp(parts_options, part)) {
|
211
|
-
query_parameters[part] =
|
213
|
+
query_parameters[part] = value;
|
212
214
|
++i;
|
213
215
|
}
|
214
216
|
}
|
215
217
|
}
|
216
|
-
return {
|
218
|
+
return { keyword_parameters, query_parameters };
|
217
219
|
}
|
218
|
-
build_route(parts, required_params, default_options, route,
|
219
|
-
const {
|
220
|
+
build_route(parts, required_params, default_options, route, absolute, args) {
|
221
|
+
const { keyword_parameters, query_parameters, } = this.partition_parameters(parts, required_params, default_options, args);
|
220
222
|
const missing_params = required_params.filter((param) => !hasProp(query_parameters, param) ||
|
221
223
|
this.is_nullable(query_parameters[param]));
|
222
224
|
if (missing_params.length) {
|
223
225
|
throw new ParametersMissing(...missing_params);
|
224
226
|
}
|
225
227
|
let result = this.get_prefix() + this.visit(route, query_parameters);
|
226
|
-
if (
|
228
|
+
if (keyword_parameters.trailing_slash) {
|
227
229
|
result = result.replace(/(.*?)[/]?$/, "$1/");
|
228
230
|
}
|
229
231
|
const url_params = this.serialize(query_parameters);
|
230
232
|
if (url_params.length) {
|
231
233
|
result += "?" + url_params;
|
232
234
|
}
|
233
|
-
result +=
|
234
|
-
|
235
|
-
|
235
|
+
result += keyword_parameters.anchor
|
236
|
+
? "#" + keyword_parameters.anchor
|
237
|
+
: "";
|
238
|
+
if (absolute) {
|
239
|
+
result = this.route_url(keyword_parameters) + result;
|
236
240
|
}
|
237
241
|
return result;
|
238
242
|
}
|
@@ -331,8 +335,8 @@ RubyVariables.WRAPPER((that) => {
|
|
331
335
|
if (this.is_array(value)) {
|
332
336
|
value = value.join("/");
|
333
337
|
}
|
334
|
-
|
335
|
-
return DeprecatedGlobbingBehavior ?
|
338
|
+
const result = this.path_identifier(value);
|
339
|
+
return DeprecatedGlobbingBehavior ? result : encodeURI(result);
|
336
340
|
}
|
337
341
|
get_prefix() {
|
338
342
|
const prefix = this.configuration.prefix;
|
@@ -340,7 +344,7 @@ RubyVariables.WRAPPER((that) => {
|
|
340
344
|
? prefix.substring(0, prefix.length - 1)
|
341
345
|
: prefix;
|
342
346
|
}
|
343
|
-
route(parts_table, route_spec,
|
347
|
+
route(parts_table, route_spec, absolute = false) {
|
344
348
|
const required_params = [];
|
345
349
|
const parts = [];
|
346
350
|
const default_options = {};
|
@@ -354,7 +358,7 @@ RubyVariables.WRAPPER((that) => {
|
|
354
358
|
}
|
355
359
|
}
|
356
360
|
const result = (...args) => {
|
357
|
-
return this.build_route(parts, required_params, default_options, route_spec,
|
361
|
+
return this.build_route(parts, required_params, default_options, route_spec, absolute, args);
|
358
362
|
};
|
359
363
|
result.requiredParams = () => required_params;
|
360
364
|
result.toString = () => {
|
@@ -456,10 +460,9 @@ RubyVariables.WRAPPER((that) => {
|
|
456
460
|
}
|
457
461
|
const Utils = new UtilsClass();
|
458
462
|
// We want this helper name to be short
|
459
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
460
463
|
const __jsr = {
|
461
|
-
r(parts_table, route_spec,
|
462
|
-
return Utils.route(parts_table, route_spec,
|
464
|
+
r(parts_table, route_spec, absolute) {
|
465
|
+
return Utils.route(parts_table, route_spec, absolute);
|
463
466
|
},
|
464
467
|
};
|
465
468
|
const result = {
|
data/lib/routes.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["routes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0DH,aAAa,CAAC,OAAO,CACnB,CAAC,IAAa,EAAwB,EAAE;IACtC,MAAM,OAAO,GAAG,CAAC,KAAc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C;IACvC,MAAM,KAAK,GAAG;QACZ,CAAC,CACC,WAAuB,EACvB,UAAqB,EACrB,QAAkB;YAElB,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,GAAG,KAAK;QACR,SAAS,EAAE,CAAC,MAA8B,EAAE,EAAE;YAC5C,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,EAAE,GAAkB,EAAE;YAC1B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;QACxB,CAAC;QACD,SAAS,EAAE,CAAC,MAAe,EAAU,EAAE;YACrC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,GAAG,aAAa,CAAC,aAAa;KAC/B,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAEvD,IAAI,aAAa,CAAC,WAAW,EAAE;QAC7B,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;KACxD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC,IAAI,CAAC,CAAC"}
|
data/lib/routes.ts
CHANGED
@@ -248,7 +248,7 @@ RubyVariables.WRAPPER(
|
|
248
248
|
|
249
249
|
path_identifier(object: unknown): string {
|
250
250
|
const result = this.unwrap_path_identifier(object);
|
251
|
-
return this.is_nullable(result) ? "" : "" + result;
|
251
|
+
return this.is_nullable(result) || result === false ? "" : "" + result;
|
252
252
|
}
|
253
253
|
|
254
254
|
unwrap_path_identifier(object: any): unknown {
|
@@ -274,7 +274,7 @@ RubyVariables.WRAPPER(
|
|
274
274
|
default_options: RouteParameters,
|
275
275
|
call_arguments: RouteParameter[]
|
276
276
|
): {
|
277
|
-
|
277
|
+
keyword_parameters: KeywordUrlOptions;
|
278
278
|
query_parameters: RouteParameters;
|
279
279
|
} {
|
280
280
|
// eslint-disable-next-line prefer-const
|
@@ -301,13 +301,13 @@ RubyVariables.WRAPPER(
|
|
301
301
|
...options,
|
302
302
|
};
|
303
303
|
|
304
|
-
const
|
304
|
+
const keyword_parameters: KeywordUrlOptions = {};
|
305
305
|
const query_parameters: RouteParameters = {};
|
306
306
|
for (const key in options) {
|
307
307
|
if (!hasProp(options, key)) continue;
|
308
308
|
const value = options[key];
|
309
309
|
if (this.is_reserved_option(key)) {
|
310
|
-
|
310
|
+
keyword_parameters[key] = value as any;
|
311
311
|
} else {
|
312
312
|
if (
|
313
313
|
!this.is_nullable(value) &&
|
@@ -321,23 +321,27 @@ RubyVariables.WRAPPER(
|
|
321
321
|
let i = 0;
|
322
322
|
for (const part of route_parts) {
|
323
323
|
if (i < args.length) {
|
324
|
+
const value = args[i];
|
324
325
|
if (!hasProp(parts_options, part)) {
|
325
|
-
query_parameters[part] =
|
326
|
+
query_parameters[part] = value;
|
326
327
|
++i;
|
327
328
|
}
|
328
329
|
}
|
329
330
|
}
|
330
|
-
return {
|
331
|
+
return { keyword_parameters, query_parameters };
|
331
332
|
}
|
332
333
|
build_route(
|
333
334
|
parts: string[],
|
334
335
|
required_params: string[],
|
335
336
|
default_options: RouteParameters,
|
336
337
|
route: RouteTree,
|
337
|
-
|
338
|
+
absolute: boolean,
|
338
339
|
args: RouteParameter[]
|
339
340
|
): string {
|
340
|
-
const {
|
341
|
+
const {
|
342
|
+
keyword_parameters,
|
343
|
+
query_parameters,
|
344
|
+
} = this.partition_parameters(
|
341
345
|
parts,
|
342
346
|
required_params,
|
343
347
|
default_options,
|
@@ -352,16 +356,18 @@ RubyVariables.WRAPPER(
|
|
352
356
|
throw new ParametersMissing(...missing_params);
|
353
357
|
}
|
354
358
|
let result = this.get_prefix() + this.visit(route, query_parameters);
|
355
|
-
if (
|
359
|
+
if (keyword_parameters.trailing_slash) {
|
356
360
|
result = result.replace(/(.*?)[/]?$/, "$1/");
|
357
361
|
}
|
358
362
|
const url_params = this.serialize(query_parameters);
|
359
363
|
if (url_params.length) {
|
360
364
|
result += "?" + url_params;
|
361
365
|
}
|
362
|
-
result +=
|
363
|
-
|
364
|
-
|
366
|
+
result += keyword_parameters.anchor
|
367
|
+
? "#" + keyword_parameters.anchor
|
368
|
+
: "";
|
369
|
+
if (absolute) {
|
370
|
+
result = this.route_url(keyword_parameters) + result;
|
365
371
|
}
|
366
372
|
return result;
|
367
373
|
}
|
@@ -485,9 +491,8 @@ RubyVariables.WRAPPER(
|
|
485
491
|
if (this.is_array(value)) {
|
486
492
|
value = value.join("/");
|
487
493
|
}
|
488
|
-
|
489
|
-
|
490
|
-
return DeprecatedGlobbingBehavior ? "" + value : encodeURI("" + value);
|
494
|
+
const result = this.path_identifier(value as any);
|
495
|
+
return DeprecatedGlobbingBehavior ? result : encodeURI(result);
|
491
496
|
}
|
492
497
|
|
493
498
|
get_prefix(): string {
|
@@ -500,7 +505,7 @@ RubyVariables.WRAPPER(
|
|
500
505
|
route(
|
501
506
|
parts_table: PartsTable,
|
502
507
|
route_spec: RouteTree,
|
503
|
-
|
508
|
+
absolute = false
|
504
509
|
): RouteHelper {
|
505
510
|
const required_params: string[] = [];
|
506
511
|
const parts: string[] = [];
|
@@ -522,7 +527,7 @@ RubyVariables.WRAPPER(
|
|
522
527
|
required_params,
|
523
528
|
default_options,
|
524
529
|
route_spec,
|
525
|
-
|
530
|
+
absolute,
|
526
531
|
args
|
527
532
|
);
|
528
533
|
};
|
@@ -648,14 +653,13 @@ RubyVariables.WRAPPER(
|
|
648
653
|
const Utils = new UtilsClass();
|
649
654
|
|
650
655
|
// We want this helper name to be short
|
651
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
652
656
|
const __jsr = {
|
653
657
|
r(
|
654
658
|
parts_table: PartsTable,
|
655
659
|
route_spec: RouteTree,
|
656
|
-
|
660
|
+
absolute?: boolean
|
657
661
|
): RouteHelper {
|
658
|
-
return Utils.route(parts_table, route_spec,
|
662
|
+
return Utils.route(parts_table, route_spec, absolute);
|
659
663
|
},
|
660
664
|
};
|
661
665
|
|
@@ -164,12 +164,13 @@ describe JsRoutes, "compatibility with Rails" do
|
|
164
164
|
|
165
165
|
context "object without prototype" do
|
166
166
|
before(:each) do
|
167
|
-
evaljs("let params = Object.create(null); params.q = 'hello'")
|
167
|
+
evaljs("let params = Object.create(null); params.q = 'hello';")
|
168
|
+
evaljs("let inbox = Object.create(null); inbox.to_param = 1;")
|
168
169
|
end
|
169
170
|
|
170
171
|
it "should still work correctly" do
|
171
|
-
expect(evaljs("Routes.inbox_path(
|
172
|
-
test_routes.inbox_path(1, :
|
172
|
+
expect(evaljs("Routes.inbox_path(inbox, params)")).to eq(
|
173
|
+
test_routes.inbox_path(1, q: "hello")
|
173
174
|
)
|
174
175
|
end
|
175
176
|
end
|
@@ -241,6 +242,15 @@ describe JsRoutes, "compatibility with Rails" do
|
|
241
242
|
expect(evaljs("Routes.things_path({ q: 'hello' })")).to eq(test_routes.things_path(q: 'hello'))
|
242
243
|
end
|
243
244
|
|
245
|
+
it "treats false as absent optional part" do
|
246
|
+
pending("https://github.com/rails/rails/issues/42280")
|
247
|
+
expect(evaljs("Routes.things_path(false)")).to eq(test_routes.things_path(false))
|
248
|
+
end
|
249
|
+
|
250
|
+
it "treats false as absent optional part when default is specified" do
|
251
|
+
expect(evaljs("Routes.campaigns_path(false)")).to eq(test_routes.campaigns_path(false))
|
252
|
+
end
|
253
|
+
|
244
254
|
it "should not require the optional parts as arguments" do
|
245
255
|
expect(evaljs("Routes.thing_path(null, 5)")).to eq(test_routes.thing_path(nil, 5))
|
246
256
|
end
|
data/spec/support/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js-routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|