Repository navigation
Pass 1: W1, W3, W4, W13, W14, W15 - #28
Merged
Merged
Conversation
The declaration build used tsconfig.json (include src/**/*), so 43 *.test.d.ts and their maps went into dist and the package. Rollup now uses tsconfig.build.json, which excludes src/**/*.test.ts; jest and npm run typecheck keep using tsconfig.json. files drops dist/**/*.map and dist/**/*.test.d.ts; the dead .npmignore (files overrides it) is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
session.ts:64, session.ts:121 and storage.ts:229 called console.log on every site. SessionManager takes the SDK debug flag and logs through a private log(); migrateFromLegacyPrefix(debug) logs the count only in debug mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eout comment The three options are read nowhere. They stay accepted, marked @deprecated. The sessionTimeout default is 30 minutes since 1.9.4, not 60. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They read managers init() creates and threw a TypeError before it. Return
types are unchanged: '' for ids typed string, null where the type allows it,
{} / [] for attribution and journey, a navigator-based network status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s not on npm Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s reference them); changelog note on getStripeMetadata() before init() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Independent review: APPROVE (no change to what is sent; package still ships everything consumers and the main repo's dl.js build read). Follow-ups applied in the last commit: the JavaScript source maps ship again because the bundles reference them (only declaration maps and test type files are left out now), and the changelog notes that |
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.
W1: npm package ships no test declarations and no source maps
tsconfig.json(include: src/**/*), so everysrc/**/*.test.tsproduced a.test.d.ts+.test.d.ts.mapindist, andfiles: ["dist"]shipped them with all JS and declaration source maps..npmignorewas dead (filesoverrides it).rollup.config.jsuses a newtsconfig.build.json(extendstsconfig.json, addssrc/**/*.test.tstoexclude) for all five entries. Jest (ts-jest) andnpm run typecheckstill usetsconfig.jsonand see the tests.package.jsonfilesis now["dist", "!dist/**/*.map", "!dist/**/*.test.d.ts"](decision: drop both declaration maps and JS source maps from npm; the CDN build is unaffected becausedist/itself still holds them)..npmignoredeleted.npm pack --dry-run --ignore-scripts --jsonrun once on the existingdist(before). The after list applies the newfilespatterns to that same list (the new tsconfig also stops the.test.d.tsfiles from being emitted at all).*.test.d.ts+ maps, 77.map= 1.97 MB)After list:
LICENSE,README.md,package.json,dist/datalyr.js,dist/datalyr.min.js,dist/datalyr.esm.js,dist/datalyr.esm.min.js,dist/datalyr.cjs.js,dist/datalyr.pixels.min.js,dist/datalyr.replay.min.js, and 26 public declarations:dist/{attribution,auto-identify,config,container,destination-pixels,encryption,fingerprint,identity,in-app-handoff,index,queue,replay-loader,session,shopify-cart,shopify-product-view,storage,stripe-session,types,utils}.d.ts,dist/pixels/{applovin,index,linkedin,x}.d.ts,dist/replay/{heat,privacy,recorder,selector}.d.ts.npm run build+ bundle guard.main/exportsuntouched (W2 later).W3: three
console.logcalls not behind debugsrc/session.ts:64(creation already in progress),src/session.ts:121(session id rotated),src/storage.ts:229(legacy keys migrated) logged on every site.SessionManager(timeout, debug = false)with a privatelog()like the queue's;storage.migrateFromLegacyPrefix(debug = false);src/index.tspassesthis.config.debugto both.src/debug-logging.test.ts(rotation and migration print nothing without debug, and do with it; the "without" cases fail on main).W4: options that do nothing
flushAt,trackSessions,cookiePrefixare read nowhere; thesessionTimeoutcomment said 60 minutes (code is 30 since 1.9.4,src/index.ts:192).@deprecatedJSDoc on the three insrc/types.ts(still accepted, defaults inindex.tsunchanged);sessionTimeoutcomment corrected. No behaviour change, so no test.W13: getters threw a TypeError before
init()this.identity/this.session/this.attribution/this.queue, whichinit()creates.getAnonymousId,getVisitorId,getDistinctId,getUserId,getSessionId,getSessionData,getStripeMetadata,getWhopCheckoutMetadata,getAttribution,getJourney,getNetworkStatuscheck their manager, warn once per instance, and return an empty value. Least breaking choice: no return type changes. Ids typedstringreturn'';getUserId/getSessionDatareturnnull(already in their types);getStripeMetadatareturns''ids;getAttribution{};getJourney[];getNetworkStatus{ isOnline: navigator.onLine, lastOfflineAt: null, lastOnlineAt: null }. The guard checks the manager, notinitialized, so nothing changes afterinit()(or afterdestroy(), which keeps the managers).src/getters-before-init.test.ts(each getter does not throw and returns its empty value; one warning per instance; getters that already handled this are unchanged).W14: tests for untested modules
src/fingerprint.test.ts: minimal fields in strict mode and withenableFingerprinting: false; standard reads; screen rounding to 100px;dntfrom DNT / GPC; client hints;generateHashwith Web Crypto (SHA-256 of key-sorted JSON) and without (stable, order-independent).src/pixels-module.test.ts:src/pixels/index.tscontract version and platforms; unknown and inherited keys blocked; load / track delegate with their arguments; a throwing platform is contained;window.DatalyrPixelsregistration and an existing one kept.W15: changelog
## Unreleasedat the top with this PR's changes; the stray empty## [Unreleased]mid-file (above[1.7.13]) removed.npm view @datalyr/web versions): 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.3, 1.9.6, 1.9.7; in that range only 1.9.2, 1.9.4 and 1.9.5 are on npm. Also listed: 1.7.7, 1.7.10, 1.7.11.Changes to what the SDK sends
None. No event id, name, payload field or send timing changes.
Not done
setAttribution()andstartNewSession()also touch the managers beforeinit(), but they are setters, not getters; left for a later item.package.jsonmain/exports(W2), dependencies (W19) and CI untouched as asked. No version bump.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.