BUILD #4: Interop 2026 safe CSS feature adoption rules#73
Draft
nujovich wants to merge 4 commits into
Draft
Conversation
Add getProjectBrowserslist() and getResolvedBrowsers() to lib/css-compat-data.mjs. Resolves the target browsers from package.json (browserslist key, incl. the production env block), a .browserslistrc/browserslist file, or the browserslist default. getResolvedBrowsers() runs the queries through the browserslist engine to produce concrete browser identifiers (e.g. chrome 120). Add browserslist to dependencies and install web-features (imported by M1 but missing on clean checkout). Co-Authored-By: Hermes BUILD <hermes@nousresearch.com>
getResolvedBrowsers used require() which is undefined in an ES module scope and would crash at runtime. Use createRequire(import.meta.url) to load the CommonJS browserslist package. Verified with ad-hoc script. Co-Authored-By: Hermes BUILD <hermes@nousresearch.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card: https://github.com/nujovich/mint-radar/issues/4
Decision: Option B (Medium scope — detection with concrete fallback suggestions)
Milestones
Milestone 2 detail
Added project browserslist discovery to
lib/css-compat-data.mjs:getProjectBrowserslist(projectDir)resolves the target browsers in priority order: abrowserslistkey inpackage.json(supports both a flat array and the{ production, development }env-block form, using the production query), then a.browserslistrc/browserslistfile (comment lines starting with#are skipped), and finally the browserslist default (> 0.5%, last 2 versions, Firefox ESR, not dead). It returns{ queries, source }so callers know which source won.getResolvedBrowsers(projectDir)runs the queries through thebrowserslistengine and returns the concrete browser identifiers (e.g.chrome 120,safari 17) plus the originalqueriesandsource.browserslistadded topackage.jsondependencies (andpackage-lock.json);web-featureswas also installed intonode_modules(it was imported by M1 but not yet present on a clean checkout).Tests
lib/__tests__/css-compat-data.test.mjs: reads browserslist from package.json, reads theproductionenv block, prefers.browserslistrcover the package.json default, falls back to the browserslist default, and resolves queries into concrete browser identifiers.How to test
(319 lib tests passing at time of commit.)