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

Eliminate recursion from candidatePermutations #7331

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Feb 4, 2022

V8 (and therefore Node) does not support Proper Tail Calls. Passing very long dash separated strings to candidatePermutations will cause Node to hit a max stack size. I replaced the recursion with a while loop which should eliminate this possibility. This should theoretically reduce memory usage as well since it doesn't have to save/restore stack space for the recursive function calls.

This is a possible fix for: #7330

@thecrypticace thecrypticace marked this pull request as ready for review February 7, 2022 14:50
@thecrypticace thecrypticace merged commit dc6644e into master Feb 7, 2022
@thecrypticace thecrypticace deleted the fix/candidate-recursion-stack branch February 7, 2022 14:52
dukex added a commit to dukex/tailwindcss-rails that referenced this pull request Feb 15, 2022
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
dhh pushed a commit to rails/tailwindcss-rails that referenced this pull request Feb 19, 2022
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
aisen-lopez pushed a commit to aisen-lopez/rails-tailwindcss-template that referenced this pull request Apr 1, 2022
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
anderscain63 added a commit to anderscain63/tailwindcss-rails that referenced this pull request Dec 20, 2022
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
titan2gman added a commit to titan2gman/tailwindcss-rails that referenced this pull request Dec 27, 2022
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
@ivangermanov
Copy link

Is it possible to merge this back into a patch release for tailwind v2?

smartech7 pushed a commit to smartech7/rails-tailwind-css that referenced this pull request Aug 4, 2023
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
XLoopLion added a commit to XLoopLion/tailwindcss-rails that referenced this pull request Jun 12, 2024
# CHANGELOG

## [3.0.22] - 2022-02-11

### Fixed

- Temporarily move postcss to dependencies ([#7424](tailwindlabs/tailwindcss#7424))

## [3.0.21] - 2022-02-10

### Fixed

- Move prettier plugin to dev dependencies ([#7418](tailwindlabs/tailwindcss#7418))

## [3.0.20] - 2022-02-10

### Added

- Expose `context.sortClassList(classes)` ([#7412](tailwindlabs/tailwindcss#7412))

## [3.0.19] - 2022-02-07

### Fixed

- Fix preflight border color fallback ([#7288](tailwindlabs/tailwindcss#7288))
- Correctly parse shadow lengths without a leading zero ([#7289](tailwindlabs/tailwindcss#7289))
- Don't crash when scanning extremely long class candidates ([#7331](tailwindlabs/tailwindcss#7331))
- Use less hacky fix for URLs detected as custom properties ([#7275](tailwindlabs/tailwindcss#7275))
- Correctly generate negative utilities when dash is before the prefix ([#7295](tailwindlabs/tailwindcss#7295))
- Detect prefixed negative utilities in the safelist ([#7295](tailwindlabs/tailwindcss#7295))

## [3.0.18] - 2022-01-28

### Fixed

- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](tailwindlabs/tailwindcss#7232))
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](tailwindlabs/tailwindcss#7252))

## [3.0.17] - 2022-01-26

### Fixed

- Remove false positive warning in CLI when using the `--content` option ([#7220](tailwindlabs/tailwindcss#7220))

## [3.0.16] - 2022-01-24

### Fixed

- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](tailwindlabs/tailwindcss#7080))
- Improve various warnings ([#7118](tailwindlabs/tailwindcss#7118))
- Fix grammatical mistake ([cca5a38](tailwindlabs/tailwindcss@cca5a38))
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.

2 participants