File tree 14 files changed +454
-1953
lines changed
14 files changed +454
-1953
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ filegroup(
24
24
"rtti.c++" ,
25
25
"url.c++" ,
26
26
"urlpattern.c++" ,
27
+ "urlpattern-standard.c++" ,
27
28
"util.c++" ,
28
29
],
29
30
),
@@ -49,6 +50,7 @@ filegroup(
49
50
"rtti.h" ,
50
51
"url.h" ,
51
52
"urlpattern.h" ,
53
+ "urlpattern-standard.h" ,
52
54
"util.h" ,
53
55
],
54
56
),
@@ -249,6 +251,18 @@ wd_cc_library(
249
251
],
250
252
)
251
253
254
+ wd_cc_library (
255
+ name = "urlpattern-standard" ,
256
+ srcs = ["urlpattern-standard.c++" ],
257
+ hdrs = ["urlpattern-standard.h" ],
258
+ visibility = ["//visibility:public" ],
259
+ deps = [
260
+ "//src/workerd/jsg" ,
261
+ "@ada-url" ,
262
+ "@capnp-cpp//src/kj" ,
263
+ ],
264
+ )
265
+
252
266
####################################################################################################
253
267
## Tests
254
268
Original file line number Diff line number Diff line change 19
19
#include < workerd/api/streams/standard.h>
20
20
#include < workerd/api/trace.h>
21
21
#include < workerd/api/url-standard.h>
22
+ #include < workerd/api/urlpattern-standard.h>
22
23
#include < workerd/api/urlpattern.h>
23
24
#include < workerd/io/compatibility-date.h>
24
25
#include < workerd/jsg/rtti.h>
25
26
27
+ // TODO(soon): Remove this once URLPattern autogate has been removed.
28
+ #include < workerd/util/autogate.h>
29
+
26
30
#include < kj/test.h>
27
31
28
32
// Test building rtti for various APIs.
@@ -31,13 +35,15 @@ namespace workerd::api {
31
35
namespace {
32
36
33
37
KJ_TEST (" WorkerGlobalScope" ) {
38
+ util::Autogate::initAutogate ({});
34
39
jsg::rtti::Builder builder ((CompatibilityFlags::Reader ()));
35
40
builder.structure <WorkerGlobalScope>();
36
41
KJ_EXPECT (builder.structure (" workerd::api::Event" _kj) != kj::none);
37
42
KJ_EXPECT (builder.structure (" workerd::api::ObviouslyWrongName" _kj) == kj::none);
38
43
}
39
44
40
45
KJ_TEST (" ServiceWorkerGlobalScope" ) {
46
+ util::Autogate::initAutogate ({});
41
47
jsg::rtti::Builder builder ((CompatibilityFlags::Reader ()));
42
48
builder.structure <ServiceWorkerGlobalScope>();
43
49
KJ_EXPECT (builder.structure (" workerd::api::DurableObjectId" _kj) != kj::none);
Original file line number Diff line number Diff line change 10
10
11
11
#include < workerd/io/io-timers.h>
12
12
#include < workerd/jsg/jsg.h>
13
+ #include < workerd/util/autogate.h>
13
14
#ifdef WORKERD_EXPERIMENTAL_ENABLE_WEBGPU
14
15
#include < workerd/api/gpu/gpu.h>
15
16
#endif
@@ -52,11 +53,15 @@ class CompressionStream;
52
53
class DecompressionStream ;
53
54
class TextEncoderStream ;
54
55
class TextDecoderStream ;
55
- class URLPattern ;
56
56
class Blob ;
57
57
class File ;
58
58
class FormData ;
59
59
60
+ class URLPattern ;
61
+ namespace urlpattern {
62
+ class URLPattern ;
63
+ } // namespace urlpattern
64
+
60
65
class URL ;
61
66
class URLSearchParams ;
62
67
namespace url {
@@ -708,7 +713,13 @@ class ServiceWorkerGlobalScope: public WorkerGlobalScope {
708
713
JSG_NESTED_TYPE (URL);
709
714
JSG_NESTED_TYPE (URLSearchParams);
710
715
}
711
- JSG_NESTED_TYPE (URLPattern);
716
+
717
+ // We conditionally enable a more spec compliant URLPattern to avoid any breakages.
718
+ if (util::Autogate::isEnabled (util::AutogateKey::URLPATTERN)) {
719
+ JSG_NESTED_TYPE_NAMED (urlpattern::URLPattern, URLPattern);
720
+ } else {
721
+ JSG_NESTED_TYPE (URLPattern);
722
+ }
712
723
713
724
JSG_NESTED_TYPE (Blob);
714
725
JSG_NESTED_TYPE (File);
Original file line number Diff line number Diff line change 30
30
#include < workerd/api/trace.h>
31
31
#include < workerd/api/unsafe.h>
32
32
#include < workerd/api/url-standard.h>
33
+ #include < workerd/api/urlpattern-standard.h>
33
34
#include < workerd/api/urlpattern.h>
34
35
#include < workerd/api/worker-rpc.h>
35
36
#include < workerd/io/compatibility-date.h>
76
77
F(" url" , EW_URL_ISOLATE_TYPES) \
77
78
F(" url-standard" , EW_URL_STANDARD_ISOLATE_TYPES) \
78
79
F(" url-pattern" , EW_URLPATTERN_ISOLATE_TYPES) \
80
+ F(" url-pattern-standard" , EW_URLPATTERN_STANDARD_ISOLATE_TYPES) \
79
81
F(" websocket" , EW_WEBSOCKET_ISOLATE_TYPES) \
80
82
F(" sql" , EW_SQL_ISOLATE_TYPES) \
81
83
F(" sockets" , EW_SOCKETS_ISOLATE_TYPES) \
You can’t perform that action at this time.
0 commit comments