Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upate swc to allow line comments in css #29943

Merged
merged 9 commits into from Oct 15, 2021
Merged

Upate swc to allow line comments in css #29943

merged 9 commits into from Oct 15, 2021

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Oct 15, 2021

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes

styfle
styfle previously approved these changes Oct 15, 2021
@@ -173,6 +175,7 @@ impl Namespacer {
&args,
ParserConfig {
parse_values: false,
allow_wrong_line_comments: true,
Copy link
Member

Choose a reason for hiding this comment

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

Its not really "wrong", just not standardized in the spec. It works it some browsers.

I would call this allow_nonstandard_line_comments or allow_unofficial_line_comments 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, nonstandard seems better.
Thasnk!

@ijjk

This comment has been minimized.

@reevesPAC

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Oct 15, 2021

Stats from current PR

Default Build (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary kdy1/next.js swc Change
buildDuration 12.3s 12.2s -122ms
buildDurationCached 4.3s 2.9s -1.4s
nodeModulesSize 201 MB 199 MB -1.45 MB
Page Load Tests Overall increase ✓
vercel/next.js canary kdy1/next.js swc Change
/ failed reqs 0 0
/ total time (seconds) 2.828 2.857 ⚠️ +0.03
/ avg req/sec 884.1 875.08 ⚠️ -9.02
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.328 1.32 -0.01
/error-in-render avg req/sec 1882.19 1894.03 +11.84
Client Bundles (main, webpack, commons)
vercel/next.js canary kdy1/next.js swc Change
779.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 27 kB 27 kB
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 70.9 kB 70.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary kdy1/next.js swc Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kdy1/next.js swc Change
_app-HASH.js gzip 977 B 977 B
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 311 B 311 B
css-HASH.js gzip 328 B 328 B
dynamic-HASH.js gzip 2.67 kB 2.67 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 918 B 918 B
image-HASH.js gzip 4.14 kB 4.14 kB
index-HASH.js gzip 260 B 260 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 319 B 319 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 13 kB 13 kB
Client Build Manifests
vercel/next.js canary kdy1/next.js swc Change
_buildManifest.js gzip 493 B 493 B
Overall change 493 B 493 B
Rendered Page Sizes
vercel/next.js canary kdy1/next.js swc Change
index.html gzip 540 B 540 B
link.html gzip 551 B 551 B
withRouter.html gzip 533 B 533 B
Overall change 1.62 kB 1.62 kB

Default Build with SWC (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary kdy1/next.js swc Change
buildDuration 6.2s 6.3s ⚠️ +62ms
buildDurationCached 2.9s 2.9s ⚠️ +26ms
nodeModulesSize 201 MB 199 MB -1.45 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary kdy1/next.js swc Change
/ failed reqs 0 0
/ total time (seconds) 2.774 2.862 ⚠️ +0.09
/ avg req/sec 901.38 873.55 ⚠️ -27.83
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.29 1.284 -0.01
/error-in-render avg req/sec 1937.69 1946.41 +8.72
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary kdy1/next.js swc Change
675-HASH.js gzip 13.8 kB 13.8 kB
770.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 50.8 kB 50.8 kB
main-HASH.js gzip 35.1 kB 35.1 kB ⚠️ +2 B
webpack-HASH.js gzip 1.64 kB 1.64 kB
Overall change 101 kB 101 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary kdy1/next.js swc Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kdy1/next.js swc Change
_app-HASH.js gzip 1.33 kB 1.33 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 315 B 315 B
css-HASH.js gzip 331 B 331 B
dynamic-HASH.js gzip 2.79 kB 2.79 kB
head-HASH.js gzip 355 B 355 B
hooks-HASH.js gzip 637 B 637 B
image-HASH.js gzip 555 B 555 B
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.22 kB 2.22 kB
routerDirect..HASH.js gzip 326 B 326 B
script-HASH.js gzip 393 B 393 B
withRouter-HASH.js gzip 322 B 322 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 10.1 kB 10.1 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary kdy1/next.js swc Change
_buildManifest.js gzip 511 B 510 B -1 B
Overall change 511 B 510 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary kdy1/next.js swc Change
index.html gzip 538 B 538 B
link.html gzip 552 B 551 B -1 B
withRouter.html gzip 533 B 532 B -1 B
Overall change 1.62 kB 1.62 kB -2 B

Diffs

Diff for _buildManifest.js
@@ -17,7 +17,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Fhooks-7fa8f6299881aeef4d92.js"
   ],
   "/image": [
-    "static\u002Fchunks\u002F675-ffd8e0a2b0069cbe0b83.js",
+    "static\u002Fchunks\u002F675-9c6edfe56b83ffcb92d8.js",
     "static\u002Fchunks\u002Fpages\u002Fimage-24dfc0766459a85ca885.js"
   ],
   "/link": ["static\u002Fchunks\u002Fpages\u002Flink-d5bdd3af9bbbd881abda.js"],
Diff for 675-HASH.js
@@ -2371,7 +2371,6 @@
           _nonIterableSpread()
         );
       }
-      var _Math;
       __webpack_unused_export__ = {
         value: true
       };
@@ -2515,6 +2514,7 @@
             percentSizes.push(parseInt(match[2]));
           }
           if (percentSizes.length) {
+            var _Math;
             var smallestRatio =
               (_Math = Math).min.apply(
                 _Math,
Diff for main-HASH.js
@@ -2306,14 +2306,13 @@
           _nonIterableSpread()
         );
       }
-      var _router, __singletonRouter, _scopedRouter;
       Object.defineProperty(exports, "__esModule", {
         value: true
       });
       Object.defineProperty(exports, "Router", {
         enumerable: true,
         get: function get() {
-          return _router1.default;
+          return _router.default;
         }
       });
       Object.defineProperty(exports, "withRouter", {
@@ -2327,7 +2326,7 @@
       exports.makePublicRouterInstance = makePublicRouterInstance;
       exports["default"] = void 0;
       var _react = _interopRequireDefault(__webpack_require__(7294));
-      var _router1 = _interopRequireDefault(__webpack_require__(6542));
+      var _router = _interopRequireDefault(__webpack_require__(6542));
       var _routerContext = __webpack_require__(9237);
       var _isError = _interopRequireDefault(__webpack_require__(676));
       var _withRouter = _interopRequireDefault(__webpack_require__(8738));
@@ -2384,7 +2383,7 @@
       // Events is a static property on the router, the router doesn't have to be initialized to use it
       Object.defineProperty(singletonRouter, "events", {
         get: function() {
-          return _router1.default.events;
+          return _router.default.events;
         }
       });
       urlPropertyFields.forEach(function(field) {
@@ -2408,6 +2407,7 @@
           ) {
             args[_key] = arguments[_key];
           }
+          var _router;
           var router = getRouter();
           return (_router = router)[field].apply(
             _router,
@@ -2417,7 +2417,7 @@
       });
       routerEvents.forEach(function(event) {
         singletonRouter.ready(function() {
-          _router1.default.events.on(event, function() {
+          _router.default.events.on(event, function() {
             for (
               var _len = arguments.length, args = new Array(_len), _key = 0;
               _key < _len;
@@ -2431,6 +2431,7 @@
             var _singletonRouter = singletonRouter;
             if (_singletonRouter[eventField]) {
               try {
+                var __singletonRouter;
                 (__singletonRouter = _singletonRouter)[eventField].apply(
                   __singletonRouter,
                   _toConsumableArray(args)
@@ -2472,7 +2473,7 @@
           args[_key] = arguments[_key];
         }
         singletonRouter.router = _construct(
-          _router1.default,
+          _router.default,
           _toConsumableArray(args)
         );
         singletonRouter.readyCallbacks.forEach(function(cb) {
@@ -2518,7 +2519,7 @@
           }
         }
         // Events is a static property on the router, the router doesn't have to be initialized to use it
-        instance.events = _router1.default.events;
+        instance.events = _router.default.events;
         coreMethodFields.forEach(function(field) {
           instance[field] = function() {
             for (
@@ -2528,6 +2529,7 @@
             ) {
               args[_key] = arguments[_key];
             }
+            var _scopedRouter;
             return (_scopedRouter = scopedRouter)[field].apply(
               _scopedRouter,
               _toConsumableArray(args)
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-1c79c5ac6d5b9e939bf5.js"
+      src="/_next/static/chunks/main-4d9be84fbb3e49256a54.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-1c79c5ac6d5b9e939bf5.js"
+      src="/_next/static/chunks/main-4d9be84fbb3e49256a54.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-1c79c5ac6d5b9e939bf5.js"
+      src="/_next/static/chunks/main-4d9be84fbb3e49256a54.js"
       defer=""
     ></script>
     <script
Commit: 60a01a4

@timneutkens timneutkens merged commit e844582 into vercel:canary Oct 15, 2021
@timneutkens timneutkens deleted the swc branch October 15, 2021 15:25
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants