@angular/ssr 22.0.0-next.7 → 22.0.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/ssr",
3
- "version": "22.0.0-next.7",
3
+ "version": "22.0.0-next.8",
4
4
  "description": "Angular server side rendering utilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@angular-devkit/schematics": "workspace:*",
32
- "@angular/common": "22.0.0-next.9",
33
- "@angular/compiler": "22.0.0-next.9",
34
- "@angular/core": "22.0.0-next.9",
35
- "@angular/platform-browser": "22.0.0-next.9",
36
- "@angular/platform-server": "22.0.0-next.9",
37
- "@angular/router": "22.0.0-next.9",
32
+ "@angular/common": "22.0.0-next.12",
33
+ "@angular/compiler": "22.0.0-next.12",
34
+ "@angular/core": "22.0.0-next.12",
35
+ "@angular/platform-browser": "22.0.0-next.12",
36
+ "@angular/platform-server": "22.0.0-next.12",
37
+ "@angular/router": "22.0.0-next.12",
38
38
  "@schematics/angular": "workspace:*",
39
39
  "beasties": "0.4.2"
40
40
  },
@@ -636,11 +636,12 @@ function requireStringifier () {
636
636
  }
637
637
 
638
638
  atrule(node, semicolon) {
639
+ let raws = node.raws;
639
640
  let name = '@' + node.name;
640
641
  let params = node.params ? this.rawValue(node, 'params') : '';
641
642
 
642
- if (typeof node.raws.afterName !== 'undefined') {
643
- name += node.raws.afterName;
643
+ if (typeof raws.afterName !== 'undefined') {
644
+ name += raws.afterName;
644
645
  } else if (params) {
645
646
  name += ' ';
646
647
  }
@@ -648,7 +649,7 @@ function requireStringifier () {
648
649
  if (node.nodes) {
649
650
  this.block(node, name + params);
650
651
  } else {
651
- let end = (node.raws.between || '') + (semicolon ? ';' : '');
652
+ let end = (raws.between || '') + (semicolon ? ';' : '');
652
653
  this.builder(escapeHTMLInCSS(name + params + end), node);
653
654
  }
654
655
  }
@@ -699,16 +700,17 @@ function requireStringifier () {
699
700
  }
700
701
 
701
702
  body(node) {
702
- let last = node.nodes.length - 1;
703
+ let nodes = node.nodes;
704
+ let last = nodes.length - 1;
703
705
  while (last > 0) {
704
- if (node.nodes[last].type !== 'comment') break
706
+ if (nodes[last].type !== 'comment') break
705
707
  last -= 1;
706
708
  }
707
709
 
708
710
  let semicolon = this.raw(node, 'semicolon');
709
711
  let isDocument = node.type === 'document';
710
- for (let i = 0; i < node.nodes.length; i++) {
711
- let child = node.nodes[i];
712
+ for (let i = 0; i < nodes.length; i++) {
713
+ let child = nodes[i];
712
714
  let before = this.raw(child, 'before');
713
715
  if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before));
714
716
  this.stringify(child, last !== i || semicolon);
@@ -722,11 +724,13 @@ function requireStringifier () {
722
724
  }
723
725
 
724
726
  decl(node, semicolon) {
727
+ let raws = node.raws;
725
728
  let between = this.raw(node, 'between', 'colon');
729
+
726
730
  let string = node.prop + between + this.rawValue(node, 'value');
727
731
 
728
732
  if (node.important) {
729
- string += node.raws.important || ' !important';
733
+ string += raws.important || ' !important';
730
734
  }
731
735
 
732
736
  if (semicolon) string += ';';
@@ -766,9 +770,9 @@ function requireStringifier () {
766
770
 
767
771
  // Detect style by other nodes
768
772
  let root = node.root();
769
- if (!root.rawCache) root.rawCache = {};
770
- if (typeof root.rawCache[detect] !== 'undefined') {
771
- return root.rawCache[detect]
773
+ let cache = root.rawCache || (root.rawCache = {});
774
+ if (typeof cache[detect] !== 'undefined') {
775
+ return cache[detect]
772
776
  }
773
777
 
774
778
  if (detect === 'before' || detect === 'after') {
@@ -787,7 +791,7 @@ function requireStringifier () {
787
791
 
788
792
  if (typeof value === 'undefined') value = DEFAULT_RAW[detect];
789
793
 
790
- root.rawCache[detect] = value;
794
+ cache[detect] = value;
791
795
  return value
792
796
  }
793
797
 
@@ -2108,6 +2112,7 @@ function requirePreviousMap () {
2108
2112
  class PreviousMap {
2109
2113
  constructor(css, opts) {
2110
2114
  if (opts.map === false) return
2115
+ if (opts.unsafeMap) this.unsafeMap = true;
2111
2116
  this.loadAnnotation(css);
2112
2117
  this.inline = this.startWith(this.annotation, 'data:');
2113
2118
 
@@ -2122,7 +2127,7 @@ function requirePreviousMap () {
2122
2127
 
2123
2128
  consumer() {
2124
2129
  if (!this.consumerCache) {
2125
- this.consumerCache = new SourceMapConsumer(this.text);
2130
+ this.consumerCache = new SourceMapConsumer(this.json || this.text);
2126
2131
  }
2127
2132
  return this.consumerCache
2128
2133
  }
@@ -2175,7 +2180,13 @@ function requirePreviousMap () {
2175
2180
  }
2176
2181
  }
2177
2182
 
2178
- loadFile(path) {
2183
+ loadFile(path, cssFile, trusted) {
2184
+ /* c8 ignore next 5 */
2185
+ if (!trusted && !this.unsafeMap) {
2186
+ if (!/\.map$/i.test(path)) {
2187
+ return undefined
2188
+ }
2189
+ }
2179
2190
  this.root = dirname(path);
2180
2191
  if (existsSync(path)) {
2181
2192
  this.mapFile = path;
@@ -2192,7 +2203,7 @@ function requirePreviousMap () {
2192
2203
  } else if (typeof prev === 'function') {
2193
2204
  let prevPath = prev(file);
2194
2205
  if (prevPath) {
2195
- let map = this.loadFile(prevPath);
2206
+ let map = this.loadFile(prevPath, file, true);
2196
2207
  if (!map) {
2197
2208
  throw new Error(
2198
2209
  'Unable to load previous source map: ' + prevPath.toString()
@@ -2216,7 +2227,16 @@ function requirePreviousMap () {
2216
2227
  } else if (this.annotation) {
2217
2228
  let map = this.annotation;
2218
2229
  if (file) map = join(dirname(file), map);
2219
- return this.loadFile(map)
2230
+ let unknown = this.loadFile(map, file, false);
2231
+ if (unknown) {
2232
+ try {
2233
+ /* c8 ignore next 4 */
2234
+ this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ''));
2235
+ } catch {
2236
+ return undefined
2237
+ }
2238
+ }
2239
+ return unknown
2220
2240
  }
2221
2241
  }
2222
2242
 
@@ -3178,6 +3198,7 @@ function requireTokenize () {
3178
3198
  let pos = 0;
3179
3199
  let buffer = [];
3180
3200
  let returned = [];
3201
+ let lastBadParen = -1;
3181
3202
 
3182
3203
  function position() {
3183
3204
  return pos
@@ -3269,11 +3290,14 @@ function requireTokenize () {
3269
3290
  currentToken = ['brackets', css.slice(pos, next + 1), pos, next];
3270
3291
 
3271
3292
  pos = next;
3293
+ } else if (pos <= lastBadParen) {
3294
+ currentToken = ['(', '(', pos];
3272
3295
  } else {
3273
3296
  next = css.indexOf(')', pos + 1);
3274
3297
  content = css.slice(pos, next + 1);
3275
3298
 
3276
3299
  if (next === -1 || RE_BAD_BRACKET.test(content)) {
3300
+ lastBadParen = next === -1 ? length : next;
3277
3301
  currentToken = ['(', '(', pos];
3278
3302
  } else {
3279
3303
  currentToken = ['brackets', content, pos, next];
@@ -4580,6 +4604,19 @@ function requireLazyResult () {
4580
4604
  if (opts.stringifier) str = opts.stringifier;
4581
4605
  if (str.stringify) str = str.stringify;
4582
4606
 
4607
+ let rootSource = this.result.root.source;
4608
+ if (
4609
+ opts.map === undefined &&
4610
+ !(rootSource && rootSource.input && rootSource.input.map)
4611
+ ) {
4612
+ let result = '';
4613
+ str(this.result.root, i => {
4614
+ result += i;
4615
+ });
4616
+ this.result.css = result;
4617
+ return this.result
4618
+ }
4619
+
4583
4620
  let map = new MapGenerator(str, this.result.root, this.result.opts);
4584
4621
  let data = map.generate();
4585
4622
  this.result.css = data[0];
@@ -4912,7 +4949,7 @@ function requireProcessor () {
4912
4949
 
4913
4950
  class Processor {
4914
4951
  constructor(plugins = []) {
4915
- this.version = '8.5.10';
4952
+ this.version = '8.5.14';
4916
4953
  this.plugins = this.normalize(plugins);
4917
4954
  }
4918
4955