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

[labs/analyzer] Refactor Analyzer into better fit for use in plugins #3288

Merged
merged 9 commits into from Sep 23, 2022

Conversation

kevinpschaaf
Copy link
Member

@kevinpschaaf kevinpschaaf commented Sep 14, 2022

The previous factoring of having a ProgramContext which was responsible for creating and manipulating the TS program (in order to e.g. re-parse source files to extract jsdoc event types) was not compatible with usage in a plugin context, where the analyzer is only passed a program, and cannot modify/reparse a file within it.

This change makes the Analyzer itself the context object, and its constructor must be passed a program and fs/path abstractions and provides a getModule(path) function. The analyzer is then passed to all of the get<Model>() functions as needed for access to the program/fs/path. The ability to create a program to analyze a package on the filesystem (for current CLI gen command usage) is extracted out to a PackageAnalyzer subclass, which creates the ts.Pogram based on a tsconfig.json at the specified package root, and has the analyzePackage() method which returns a Package containing all Modules within it.

Along with this, the approach for jsdoc event type reference parsing has been redone (again):

  • The type string is parsed via a barebones language service host by inserting it into an empty source file as export type typeToParse = ${typeString} (this seems like the only way to have TS efficiently "parse" a string into syntax)
  • We only parse the string into a syntax tree, in order to walk it and identify TypeReferenceNode and ImportTypeNode. Semantic warnings are ignored, since we don't include enough in the source file or LSH to resolve references.
  • Instead, we look the referenced symbols back up in the actual program by name/location using getSymbolsInScope(), which then allows us to build Reference models for them based on where the symbol came from.
  • This approach works well enough for extracting Reference models for e.g. CEM generation. It remains to be seen whether this will be sufficient for future template typechecking uses of the analyzer, since we only get a syntax TypeNode representation of the type, and not a valid Type (and even if we convert it from a TypeNode to a Type using the typechecker, it won't be associated with working Symbols in the original program). Still, assuming we continue to use ts-simple-type, we should be able to build a SimpleType based on the syntax. This will need more work, but it can evolve later. The most important thing I aimed for in this PR is getting it into a shape that is not obviously bad for plugin usage.

Fixes #3210

@changeset-bot
Copy link

changeset-bot bot commented Sep 14, 2022

🦋 Changeset detected

Latest commit: 3d35a2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@lit-labs/analyzer Minor
@lit-labs/gen-wrapper-angular Minor
@lit-labs/gen-wrapper-react Minor
@lit-labs/gen-wrapper-vue Minor
@lit-labs/cli Patch
@lit-labs/gen-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 14, 2022

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -2% - +1% (-0.50ms - +0.32ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 73.52ms - 75.51ms
  • lit-html-kitchen-sink: unsure 🔍 -2% - +0% (-0.48ms - +0.02ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +2% (-0.25ms - +0.23ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +0% (-0.84ms - +0.25ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -0% - +3% (-0.24ms - +1.64ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 768.13ms - 787.43ms
  • lit-html-kitchen-sink: unsure 🔍 -2% - +4% (-1.46ms - +3.05ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -0% - +2% (-0.46ms - +6.44ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +1% (-1.13ms - +1.40ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +1% (-6.73ms - +5.40ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 776.97ms - 787.96ms
  • reactive-element-list: unsure 🔍 -1% - +3% (-7.83ms - +28.43ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
73.52ms - 75.51ms-

update

VersionAvg timevs
768.13ms - 787.43ms-

update-reflect

VersionAvg timevs
776.97ms - 787.96ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
28.19ms - 28.39ms-unsure 🔍
-2% - +0%
-0.48ms - +0.02ms
unsure 🔍
-1% - +1%
-0.41ms - +0.24ms
tip-of-tree
tip-of-tree
28.29ms - 28.76msunsure 🔍
-0% - +2%
-0.02ms - +0.48ms
-unsure 🔍
-1% - +2%
-0.24ms - +0.54ms
previous-release
previous-release
28.07ms - 28.68msunsure 🔍
-1% - +1%
-0.24ms - +0.41ms
unsure 🔍
-2% - +1%
-0.54ms - +0.24ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
77.20ms - 80.51ms-unsure 🔍
-2% - +4%
-1.46ms - +3.05ms
unsure 🔍
-3% - +3%
-2.57ms - +2.08ms
tip-of-tree
tip-of-tree
76.53ms - 79.59msunsure 🔍
-4% - +2%
-3.05ms - +1.46ms
-unsure 🔍
-4% - +1%
-3.27ms - +1.19ms
previous-release
previous-release
77.47ms - 80.73msunsure 🔍
-3% - +3%
-2.08ms - +2.57ms
unsure 🔍
-2% - +4%
-1.19ms - +3.27ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
24.57ms - 25.13ms-unsure 🔍
-2% - +1%
-0.50ms - +0.32ms
unsure 🔍
-3% - +1%
-0.78ms - +0.24ms
tip-of-tree
tip-of-tree
24.65ms - 25.23msunsure 🔍
-1% - +2%
-0.32ms - +0.50ms
-unsure 🔍
-3% - +1%
-0.69ms - +0.33ms
previous-release
previous-release
24.70ms - 25.54msunsure 🔍
-1% - +3%
-0.24ms - +0.78ms
unsure 🔍
-1% - +3%
-0.33ms - +0.69ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
9.76ms - 10.12ms-unsure 🔍
-2% - +2%
-0.25ms - +0.23ms
unsure 🔍
-4% - +1%
-0.35ms - +0.13ms
tip-of-tree
tip-of-tree
9.78ms - 10.11msunsure 🔍
-2% - +2%
-0.23ms - +0.25ms
-unsure 🔍
-3% - +1%
-0.34ms - +0.13ms
previous-release
previous-release
9.88ms - 10.22msunsure 🔍
-1% - +4%
-0.13ms - +0.35ms
unsure 🔍
-1% - +3%
-0.13ms - +0.34ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
291.03ms - 296.82ms-unsure 🔍
-0% - +2%
-0.46ms - +6.44ms
unsure 🔍
-1% - +1%
-2.76ms - +4.14ms
tip-of-tree
tip-of-tree
289.06ms - 292.80msunsure 🔍
-2% - +0%
-6.44ms - +0.46ms
-unsure 🔍
-2% - +0%
-4.95ms - +0.35ms
previous-release
previous-release
291.36ms - 295.11msunsure 🔍
-1% - +1%
-4.14ms - +2.76ms
unsure 🔍
-0% - +2%
-0.35ms - +4.95ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
52.37ms - 53.06ms-unsure 🔍
-2% - +0%
-0.84ms - +0.25ms
unsure 🔍
-2% - +1%
-1.28ms - +0.47ms
tip-of-tree
tip-of-tree
52.59ms - 53.43msunsure 🔍
-0% - +2%
-0.25ms - +0.84ms
-unsure 🔍
-2% - +2%
-1.02ms - +0.80ms
previous-release
previous-release
52.32ms - 53.93msunsure 🔍
-1% - +2%
-0.47ms - +1.28ms
unsure 🔍
-2% - +2%
-0.80ms - +1.02ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
113.36ms - 115.12ms-unsure 🔍
-1% - +1%
-1.13ms - +1.40ms
unsure 🔍
-2% - +1%
-2.04ms - +0.73ms
tip-of-tree
tip-of-tree
113.20ms - 115.02msunsure 🔍
-1% - +1%
-1.40ms - +1.13ms
-unsure 🔍
-2% - +1%
-2.20ms - +0.62ms
previous-release
previous-release
113.82ms - 115.97msunsure 🔍
-1% - +2%
-0.73ms - +2.04ms
unsure 🔍
-1% - +2%
-0.62ms - +2.20ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
54.35ms - 55.63ms-unsure 🔍
-0% - +3%
-0.24ms - +1.64ms
unsure 🔍
-1% - +2%
-0.58ms - +1.16ms
tip-of-tree
tip-of-tree
53.60ms - 54.98msunsure 🔍
-3% - +0%
-1.64ms - +0.24ms
-unsure 🔍
-2% - +1%
-1.31ms - +0.49ms
previous-release
previous-release
54.11ms - 55.28msunsure 🔍
-2% - +1%
-1.16ms - +0.58ms
unsure 🔍
-1% - +2%
-0.49ms - +1.31ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
782.14ms - 790.37ms-unsure 🔍
-1% - +1%
-6.73ms - +5.40ms
unsure 🔍
-1% - +1%
-4.27ms - +6.97ms
tip-of-tree
tip-of-tree
782.46ms - 791.38msunsure 🔍
-1% - +1%
-5.40ms - +6.73ms
-unsure 🔍
-0% - +1%
-3.86ms - +7.89ms
previous-release
previous-release
781.07ms - 788.74msunsure 🔍
-1% - +1%
-6.97ms - +4.27ms
unsure 🔍
-1% - +0%
-7.89ms - +3.86ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
873.83ms - 895.77ms-unsure 🔍
-1% - +3%
-7.83ms - +28.43ms
unsure 🔍
-2% - +2%
-16.04ms - +15.62ms
tip-of-tree
tip-of-tree
860.07ms - 888.94msunsure 🔍
-3% - +1%
-28.43ms - +7.83ms
-unsure 🔍
-3% - +1%
-28.90ms - +7.90ms
previous-release
previous-release
873.60ms - 896.42msunsure 🔍
-2% - +2%
-15.62ms - +16.04ms
unsure 🔍
-1% - +3%
-7.90ms - +28.90ms
-

tachometer-reporter-action v2 for Benchmarks

@kevinpschaaf kevinpschaaf changed the title [labs/analyzer] Refactor context object so that it can be passed into Analyzer [labs/analyzer] Refactor Analyzer into better fit for use in plugins Sep 14, 2022
@@ -9,7 +9,7 @@
"request": "launch",
"name": "Test",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/.bin/uvu",
"program": "${workspaceFolder}/../../../node_modules/.bin/uvu",
Copy link
Member

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

The change to npm workspaces consolidated uvu into one spot.

}
}

export const getCommandLineFromProgram = (analyzer: Analyzer) => {
Copy link
Member

Choose a reason for hiding this comment

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

Since the naming here "command line" is particularly obtuse, maybe just add a little comment saying the command line provides access to the tsconfig info and is needed to pass into other TS api calls.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

),
sourceFile,
packageJson,
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Modules need to know their package name in order to create references for things in them.

For package-local references (references to things within a given module or relative imports from it), as opposed to references imported from separate packages), we need to get the package name and jsPath for the given module. That logic is in reference.ts.

In the previous factoring, the ProgramContext held the packageJson for the package being analyzed. Since we want to be able to get a module standalone without analyzing an entire package (for plugin usage), both getModule and getPackage look up the package.json (although getPackage is factored to pass the package info into getModule so that we don't look it up over and over while analyzing an entire package.

There are TODOs in the code for figuring out a caching strategy for package.json, but haven't tackled that yet.

* Returns an analyzer `PackageInfo` model for the nearest package of the given
* path.
*/
export const getPackageInfo = (
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider putting these helpers on the analyzer class itself? Possibly simpler?

Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty much all the helpers that take analyzer as an argument could just be instance methods on the Analyzer class, but then we'd end up with a giant Analyzer class rather than a bunch of coherently collated helpers. If they're for internal use (not for the Analyzer user's use), I'm inclined to keep the current factoring.

import {getModule} from './javascript/modules.js';
import {Package} from './model.js';

/**
Copy link
Member

Choose a reason for hiding this comment

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

As per offline chat, this seems better as a factory that takes a packageRoot and returns an analyzer constructed with a program that is constructed via the packageRoot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

}
}

analyzePackage() {
Copy link
Member

Choose a reason for hiding this comment

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

If this is just a factory function then this would go on the base class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Renamed to getPackage.

Copy link
Member

@sorvell sorvell left a comment

Choose a reason for hiding this comment

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

LGTM

@kevinpschaaf kevinpschaaf merged commit 569a623 into main Sep 23, 2022
@kevinpschaaf kevinpschaaf deleted the analyzer-context branch September 23, 2022 20:46
This was referenced Oct 3, 2022
usergenic added a commit that referenced this pull request Nov 30, 2022
* Move the render function to the end of lit-html (#3284)

* Move the render function to the end of lit-html

Believe it or not, this is part of some work to better integrate with closure compiler's dead code elimination.

* Add an empty changeset.

* Fix empty changeset.

* Task: Do not reset task value or error on pending (#3283)

* [infra] Enable IntersectionController and PerformanceController tests (#3291)

Add intersection controller and performance controller tests to CI - skipping Safari.
Deflake Firefox intersection controller tests.

* [labs/ssr] fix Hydrating LitElements example markup (#3298)

* [labs/observers] Fix controllers not observing target if initialized after host connected (#3293)

Co-authored-by: Steve Orvell <sorvell@google.com>

* [labs/analyzer] Refactor Analyzer into better fit for use in plugins (#3288)

* Refactor context

* Make Analyzer implement AnalyzerInterface rather than has-a AnalyzerContext

* Add PackageInfo and pass to getModule

* Add changeset. Minor cleanup.

* Fix cli test

* Normalize rootDir

* Refactor PackageAnalyzer into factory

* Address feedback. Minor cleanup.

* Slack -> Discord readme (#3307)

* [@labs/gen-wrapper-react] TestOutput links to monorepo for dependencies (#3310)

* test-output points to the same react dependency

* remove types from tsconfig in labs_react

* restore multiple react versions

* [labs/cli] Lazily install and locally version localize (#2936)

* [cli] Lazily install and locally version localize

Also merge the two localize commands into one

They have just about the same deps and share some setup and teardown code, there's no win in putting them in separate modules.

* Use better assertions of no errors.

This should print out the stderr output in the case there was some.

* Fix error output

The .finally fork of the Promise.race result promise was causing an early exit from node before the ordinary uvu error handling could kick in.

* Fix failing test

It was passing locally because the cwd was set to the CLI directory, but we want to run in a fake workspace directory.

* Add an installation message when running npm install.

* Changeset

* Use try/finally instead of promise methods

* Move localize command into its own package.

* Task add onComplete and onError (#3287)

* [lit] Add "types" to package exports (#3320)

* [lit-html] Add `isServer` environment checker module (#3318)

Adds an `isServer` variable export to `lit` and `lit-html/is-server.js` which will be `true` in Node and `false` in the browser. This can be used when authoring components to change behavior based on whether or not the component is executing in an SSR context.

* [labs/analyzer] Adds support for analyzing JavaScript packages (#3304)

* Add support for analyzing JavaScript packages

* Fix customElements.define detection, add comments.

* Better comments / error handling

* Revert accidental SSR changes

* Add optional/non-null to model

* Run analyzer_test in JS. Add changeset.

* Fix gen-wrapper-angular

* Fix another inadvertant SSR change

* Address review feedback.

* Add test based on feedback.

* [labs/observers] Improve controllers value type from unknown to generic (#3294)

Fix value property of type `unknown` on exported controllers. The type of
`value` is now generic and can be inferred from the return type of your passed
in `callback`. The default callback `() => true` was removed, and is now
undefined by default.

* [labs/react] Provide explicit return type from createComponent (#3163)

* create params object

* add changeset

* update readme

* eeek, this requires generics

* found correct return type

* more refined type

* add ref typing

* adjust ref typings

* type forwarded instance

* expose types at top of file

* organize types

* no react window module

* no react window module

* add event listeners

* checkout readmes from main

* remove as casting in render

* remove anys

* create minimal JSXInterface for library

* save types

* jsxmodule

* attrubtes over htmlprops

* explicit return of element types

* move comments

* minimal references to window

* remove ref cast

* remove code changes, type only changes

* update changeset

* ideal

* roll back to minimal amount of changes

* types at top of file

* better comment

* rename userprops to element props

* add types to test refs

* add extends to exported element props type

* pause to sync

* add comments, more specific names for events

* update EventNames downstream

* include package types in tsconfig

* undo

* tests pass with no extra exports

* exposing element props successful

* wow only the exposed ReactWebComponent fails

* add react types to workspaces

* move types to dev deps

* remove artifacts from different PR

* remove rollup artifact from other PR

* declare types in test-output tsconfig

* capitals for classes

* add export to ReactWebComponent

* a/b the types array in test-output

* add test for ReactWebComponent type

* simplify test

* componentProps to ReactComponentProps

* type only test

* update description

* unblocked gen-wrapper-react

* add comment for type test

* restore modified files

* restore modified files, again

* remove types tsconfig property

* only export what's required

* remove old code

* add return type

* remove extra line in index

* [labs/observers] observed targets are re-observed when the host is reconnected (#3321)

Controllers now track all observed targets and will restore observing targets
when host is reconnected.

Fixes: #2902

* [labs/observers] Add unobserve method to ResizeController and IntersectionController (#3323)

Add unobserve method to `ResizeController` and `IntersectionController` to match native API.

Fixes: #3237

* [labs/gen-utils] Add core packages to testing install with link (#3330)

* [infra] Update changesets and package for release (#3332)

* Update changesets for release

* Update cli-localize package.json for release

* Add @lit-labs/cli-localize to changeset

* Remove gen-wrapper-angular from changesets (#3336)

* Version Packages (#3337)

* Unpin Node version for windows-tools test (#3338)

* [labs/react] introduce a options object (#2988)

* create params object

* add changeset

* update readme

* eeek, this requires generics

* found correct return type

* more refined type

* add ref typing

* adjust ref typings

* type forwarded instance

* expose types at top of file

* organize types

* no react window module

* no react window module

* more merge main

* initial params bag

* add changeset, remove commented code

* ReactOrParams

* destructure params

* update tests, react is optional

* remove optional react

* remove default react

* change is a patch

* forgot options.react

* [labs/react] Update REAMDE for function overload (#3350)

* initial commit

* add empty changeset

* [@lit-labs/router] add Routes.link tests (#3348)

* [gen-manifest] Initial impl of CEM generator (#2990)

* [gen-manifest] Initial impl of CEM generator

Reset changelog

Fix readme

* Sync with monorepo changes

* Fix comments

* Add variable declaration

* Update to changes on main.

* Fix version for gen-utils

* Fix analyzer version

* Fix and add tests for type reference serialization

* [labs/analyzer] Cache Module models based on dependencies. (#3333)

* Cache Module models based on dependencies.

* Cleanup and add changeset.

* Windows path fixes

* Normalize all the paths for Windows

* Move moduleCache from module var to Analyzer field.

* Add missing wireit input

* Add missing wireit output

* Fix typo in task README (#3385)

* Initializers are copied but separate from superclass initializers (#3374)

Initializers are copied but separate from superclass initializers, fixes #/3373.

* Example code had an h1 tag closed by an h3 tag (#3392)

I changed the h3 tag to be an h1 tag to match the other routes

* Improvements to Vue/React wrappers (#3377)

Updates react wrapper to correctly type events
Update vue wrapper
* update vite/vue deps
* properly type events
* configure defaults using the Vue convention: whenever unset, revert to default value.

* Wrapper test elements + runtime tests (#3384)

* Adds additional test elements
  * element-events: for testing events
  * element-props: for testing property types
  * element-slots: for testing slotting.
* Adds property types to angular wrapper

* [@labs/react] certain attributes should be removed when undefined or null (#3128)

* add sieve for boolean attributes

* unchange stuff that isn't required yet

* add changeset

* no sieve, use hasAttribute

* use hasOwnProperty

* boolean attributes should test as null

* pause

* let react handle the nullifies

* remove unnecessary return

* add comment, update changeset

* remove 232

* cascade logic over nested

* update comments

* don't watch for disabled

* show test updates and output

* hidden attr is alright

* passing tests

* set HTMLPrototype undefined values to empty string

* id is the special case

* add tests for properties

* update tests for properties

* remove nested iffs from set property

* format

* set as empty string

* change value, don't assign

* value as str

* remove attribute if undefined

* set value as string on htmlelement attr

* match vanilla react behavior

* order ifs by cost, comment alternatives

* forgot return

* checkpoint

* sync with example gist

* draggable is null

* checkpoint

* update tests, wrappedEl vs el

* test div against web component

* remove extra lines

* update changeset

* include unwrapped web component x-foo

* add null checks at end of attribute checks

* add comments, add undefined tests after boolean

* typo, enumerated

* add null checkes to test, add ts-expect-errors

* add test ordering

* forgot one truthy test

* [infra] Use new projectV2 object in issue workflow (#3419)

* Add lit to changeset along side reactive-element (#3422)

* Version Packages (#3423)

* Update chromedriver to 107 for benchmark tests (#3427)

* Update chromedriver to 107 for benchmark tests

* [labs/virtualizer] Fix width inheritance calculation (issue #3400) (#3424)

* Added a test to demonstrate virtualizer width inheritance bug in #3400
* Applied the fix to Virtualizer _updateView to interpret width correctly.
* Added changeset describing the fix for #3400.

* [labs/virtualizer] Export event classes through a new events.js (#3430)

* Added an events.js to export the RangeChangedEvent and VisibilityChangedEvent classes.

* Point to events.js to get the event classes now and moved the custom Range interface into there.

* Added events.js files to package.json's files property and the wireit outputs for build:ts.

* [labs/context] Rename context decorators to consume and provide (#3398)

* [@labs/react] Filter __forwardedRef in prod build (#3409)

* [labs/react] Filter __forwardedRef in prod build

* rebased from main, branched from react-forwarded-ref

* added changeset

* update ref setting

* add dunders back in

* add comments, update changeset

* iterrate userprops

Co-authored-by: Justin Fagnani <justinfagnani@google.com>

* [labs/context] Make @consume decorator work with optional fields (#3399)

* [labs/context] Rename ContextKey to Context (#3404)

* Allow ContextProvider to be added lazily and still work with ContextRoot (#3434)

* [infra] Fix npm install with version 9 (#3448)

* Fix dep on missing folder. Fixes npm install on npm 9.

* Add empty changeset

* Implement `lit init element` (#3248)

Co-authored-by: Justin Fagnani <justinfagnani@google.com>

* Logo dark mode support (#3457)

* Update logo.svg

* empty changeset

* lit logo dark mode

* add light theme too

* fix file locations

* use srcset

* slack to discord badge

* Gitignore build output files from virtualizer (#3454)

* Gitignore build output files from virtualizer
* add prettierignore files

* [labs/analyzer] Add lazy Declaration analysis, Reference dereferencing, and Superclass support (#3380)

* Fix comment

* Use NODE_OPTIONS=--enable-source-maps

* Make declarations lazy

* Analyze exports and add ability to dereference References to them

* Add superClass reference analysis

* Add changeset

* fixup! Use NODE_OPTIONS=--enable-source-maps

* Fix references to ImportTypes

* Add CEM generation to CLI

* Fix type import references

* Address review feedback.

* Fix path normalization on Windows

* Updates based on feedback.

* Add getSpecifierString to another site.

* [labs/gen-manifest] Adds `exports` and more metadata to manifest generator (#3464)

* Adds exports to manifest generator
Also fixes a few bugs in export analysis and adds better tests.

* Add `@slot`, `@cssProp`, and `@cssPart` to manifest generator

* Fix config to make JS program analysis faster.

* Add windows line ending to regex

* Add changeset

* Additional Windows line endings fix.

* Add support for parsing description, summary, & deprecated

* Add more exports support

* Emit summary & description in manifest.

* Gitignore build output files from virtualizer (#3454)

* Gitignore build output files from virtualizer
* add prettierignore files

* Add the js.map extension to the files property for events.js.

* update .prettierignore and .gitignore to include events.js.map

Co-authored-by: Peter Burns <rictic@google.com>
Co-authored-by: Elliott Marquez <5981958+e111077@users.noreply.github.com>
Co-authored-by: Andrew Jakubowicz <ajakubowicz@google.com>
Co-authored-by: Michael Potter <mgp140@gmail.com>
Co-authored-by: Steve Orvell <sorvell@google.com>
Co-authored-by: Kevin Schaaf <kschaaf@google.com>
Co-authored-by: Brian Taylor Vann <brian.t.vann@gmail.com>
Co-authored-by: Augustine Kim <augustinekim@google.com>
Co-authored-by: Lit Robot <98060554+lit-robot@users.noreply.github.com>
Co-authored-by: Nick Cipriani <nick.cipriani@gmail.com>
Co-authored-by: Brendan Baldwin <brendan@usergenic.com>
Co-authored-by: Justin Fagnani <justinfagnani@google.com>
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.

[labs/analyzer] Refactor analyzer into better fit for plugin use
2 participants