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

Fix SpeechSynthesis package, testing new Clipboard package, some cleanup ... #55

Merged
merged 46 commits into from
Jul 24, 2024

Conversation

Denny09310
Copy link

@Denny09310 Denny09310 commented Jul 23, 2024

This PR is somewhat the same of the Implementation one (#54), more or less I've noticed that the CodeMaid formatter is reorganizing imports and methods alphabetically. I've disable it so this huge comparisons won't appen again.

This fixes the errors caused into the SpeechSynthesis package from parsing event related types (EventMap, "on" properties, "EventListener" methods), for now I'll ignore them until the parser will be able to manage unions, intersections, functions-like parameters, etc.

Added initial clipboard package, even in this API I've found some problems, because the type alias for ClipboardItems has an array node as type so we need to handle them as well.

Bump up some dependencies.

To make it up to you I created a list that includes the files with the most important changes for this PR (excluding renaming and formatting) :

  • Blazor.Clipboard* - This are the new packages that I've made to try the revisited builders

  • Blazor.SourceGenerators/Builders/IndentationAdjustment.cs - Added some documentation

  • Blazor.SourceGenerators/Builders/*Builder.cs - Added some documentation

  • Blazor.SourceGenerators/Builders/*BuilderDetails.cs - Split the methods for better readability

  • src/Blazor.SourceGenerators/CSharp/ICSharpDependencyGraphObject.cs - Addded new dependency resolution type

  • src/Blazor.SourceGenerators/CSharp/CSharp*.cs - Changed dependency resolution with custom hashset comparer

  • src/Blazor.SourceGenerators/Extensions/CSharpMethodExtensions.cs - Revisited method types resoultion

  • src/Blazor.SourceGenerators/Parsers/TypeDeclarationParser.Interfaces.cs - Applied previous changes to accomodate to the new resolution systems

  • src/Blazor.SourceGenerators/Parsers/TypeDeclarationParserCache.cs - Added some sort of cache to avoid infinite dependency loops (noticed on test for "MediaKeySystemConfiguration")

  • tests/Blazor.SourceGenerators.Tests/*.cs - Fixes some discrepancies caused by the changes

Obviously double-checking the rest is also important, however (hopefully) this has narrowed the search field for important changes

IEvangelist and others added 30 commits October 13, 2023 10:53
…method to parse objects. Use raw strings for tests
@IEvangelist
Copy link
Owner

@Denny09310 - It looks like this work didn't start from the updated new-parser branch. Could you fix the merge conflicts?

@IEvangelist
Copy link
Owner

@all-contributors please add @Denny09310 for code, test, and ideas

Copy link
Contributor

@IEvangelist

I've put up a pull request to add @Denny09310! 🎉

@Denny09310
Copy link
Author

Denny09310 commented Jul 23, 2024

@Denny09310 - It looks like this work didn't start from the updated new-parser branch. Could you fix the merge conflicts?

Yes, you're right. I'll do it right now 😁

@Denny09310
Copy link
Author

Ok, merge done, all test are passing, tried the sample and all pages seems working as expected.

The only concern I have is, why sometimes it gives me the error on build :
"CS0246: The type or namespace name could not be found (are you missing a using directive or an assembly reference?)"

But when I build the single project that causes the error it builds correctly and then everything works? It's something related to visual studio?

@@ -74,10 +74,6 @@ async Task GetVoicesAsync(bool isFromCallback = false)

void OnTextChanged(ChangeEventArgs args) => _text = args.Value?.ToString();

void OnVoiceSpeedChange(ChangeEventArgs args) =>
Copy link
Owner

Choose a reason for hiding this comment

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

Why was this removed?

Copy link
Author

@Denny09310 Denny09310 Jul 23, 2024

Choose a reason for hiding this comment

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

As a sample I've added the "InvariantGlobalization" tag to the csproj, this permit to use the "@Bind" directive in the range slider without the need to parse the double from a string, because at least in italian the decimal separator was causing issues parsing 0.75 into 75


namespace Microsoft.JSInterop;

public class ClipboardItem
Copy link
Owner

Choose a reason for hiding this comment

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

The generator should be generating these types. The idea is that it will see the clipboard service type, and when discovering the TS type declaration, it would generate the entire API and dependent types.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I'm trying to solve that problem as for now ClipboardItems is a typealias that is not found by the TryGetDeclaration and it's not parsed yet. In the new branch that I've made in my fork (type-mapper) I'm trying to solve this issue

src/Blazor.Clipboard.WebAssembly/README.md Outdated Show resolved Hide resolved
src/Blazor.Clipboard/README.md Outdated Show resolved Hide resolved
@IEvangelist IEvangelist merged commit 1bd2b41 into IEvangelist:new-parser Jul 24, 2024
@IEvangelist
Copy link
Owner

LGTM, this is still a work in progress - but we can keep partying on this new-parser branch.

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