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

[DYN-2316] feature: consume librarie.js as npm package #15228

Conversation

Enzo707
Copy link
Contributor

@Enzo707 Enzo707 commented May 17, 2024

Purpose

This PR implements librarie.js consuming as npm package
Ref.: DYN-2316

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Reviewers

@QilongTang
@RobertGlobant20

FYIs

@mjkkirschner

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-2316

@@ -0,0 +1,45 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this file needs to be hard copied over?

Copy link
Contributor Author

@Enzo707 Enzo707 May 17, 2024

Choose a reason for hiding this comment

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

we can removed it.

Copy link

github-actions bot commented May 17, 2024

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

Copy link
Contributor

@RobertGlobant20 RobertGlobant20 left a comment

Choose a reason for hiding this comment

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

I have some minor comments and some comments about the files included in this PR.

</PropertyGroup>

<!--Extracts the file to /package-->
<Exec Command="tar -xzf $(MSBuildProjectDirectory)\$(Last).tgz --strip-components=1 --directory=web/library"></Exec>
Copy link
Contributor

Choose a reason for hiding this comment

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

are not following the same structure than for the other packages? something like Packages/LibrarieJS
image

src/LibraryViewExtensionWebView2/LibraryViewController.cs Outdated Show resolved Hide resolved
@@ -0,0 +1,45 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

you should NOT include this files as part of your PR:

  • librarie.min.js
  • librarie.min.js.LICENSE.txt
  • librarie.min.js.map
    it's is supposed that when the LibraryViewExtensionWebView2 project is build it will be downloading the package, unzip it ...... then this files will be present at that time, am i right?.

Copy link
Contributor Author

@Enzo707 Enzo707 May 17, 2024

Choose a reason for hiding this comment

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

I've seen librarie.min.js needs to be included (I suppose as it is an EmbeddedResource ) otherwise we'll get an error in Library controller related to StreamReader. @RobertGlobant20 do you know why this might be happening?

Copy link
Member

Choose a reason for hiding this comment

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

@Enzo707 have you resolved this or do you still need unblocking here?

@@ -287,23 +287,23 @@ private string ReplaceUrlWithBase64Image(string html, string minifiedURL, bool m
//list of resources which have paths embedded directly into the source.
private readonly Tuple<string, bool>[] dynamicResourcePaths = new Tuple<string, bool>[]
{
Tuple.Create("/resources/ArtifaktElement-Bold.woff",true),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the "/" is not needed?

Copy link
Contributor Author

@Enzo707 Enzo707 May 17, 2024

Choose a reason for hiding this comment

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

Why the "/" is not needed?

Because we changed the public path in package so the bundle has changed

@mjkkirschner
Copy link
Member

mjkkirschner commented May 20, 2024

Why are you committing any of the npm package contents into the repo?

Ah, I see you and @RobertGlobant20 discussed a bit above - you should be able to make sure that the build pulls the npm package before it attempts to embed the resource.

I think that having a version of the min file committed and an npm package pulled will lead to confusing build results where the actual embedded version is unclear - that is exactly what we are trying to avoid by pulling a specific version of the package.

@Enzo707
Copy link
Contributor Author

Enzo707 commented May 20, 2024

Why are you committing any of the npm package contents into the repo?

Ah, I see you and @RobertGlobant20 discussed a bit above - you should be able to make sure that the build pulls the npm package before it attempts to embed the resource.

I think that having a version of the min file committed and an npm package pulled will lead to confusing build results where the actual embedded version is unclear - that is exactly what we are trying to avoid by pulling a specific version of the package.

Why are you committing any of the npm package contents into the repo?

Ah, I see you and @RobertGlobant20 discussed a bit above - you should be able to make sure that the build pulls the npm package before it attempts to embed the resource.

I think that having a version of the min file committed and an npm package pulled will lead to confusing build results where the actual embedded version is unclear - that is exactly what we are trying to avoid by pulling a specific version of the package.

Make sense, I've removed all hard copied files that will be installed by npm package.
I was getting an error trying to read the librarie.min.js resource within the Library controller. @RobertGlobant20 please let me know if you are able to reproduce it.

@QilongTang QilongTang added this to the 3.2 milestone May 20, 2024
@mjkkirschner
Copy link
Member

what's with the failing self serve job?

@QilongTang
Copy link
Contributor

what's with the failing self serve job?

It timed out, I restarted it

@QilongTang
Copy link
Contributor

One regression to look at @Enzo707
NodeDocumentationMarkdownGeneratorTests.MarkdownGeneratorCommandTests.DictionaryContentIsFoundCorrectlyForCoreNodes

@Enzo707
Copy link
Contributor Author

Enzo707 commented May 22, 2024

One regression to look @Enzo707 DynamoCoreWpfTests.NodeAutoCompleteSearchTests.NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort_WithWhiteSpaceStartingPortName

@QilongTang I've made a rebase master on this branch and all tests passed
devenv_GoSTDlED85

pinzart90 and others added 8 commits May 22, 2024 16:07
Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com>
Co-authored-by: pinzart90 <tiberiu.pinzariu@gmail.com>
Co-authored-by: Trygve Wastvedt <trygve.wastvedt@gmail.com>
Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com>
Co-authored-by: Trygve Wastvedt <trygve.wastvedt@gmail.com>
Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com>
@@ -1,23 +1,26 @@
## In Depth

The Define Data node validates the data type of incoming data. It can be used to ensure local data is of the desired type and is also designed to be used as an input or output node, declaring the type of data a graph expects or provides. The node supports a selection of commonly used Dynamo data types, for example 'String', 'Point', or 'Boolean'. The full list of supported data types is available in the drop-down menu of the node.
Copy link
Member

Choose a reason for hiding this comment

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

seems like your PR is now touching unrelated files?

Copy link
Member

Choose a reason for hiding this comment

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

Or is this just showing commits that are already in master?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjkkirschner yep, those commits are in master already

@QilongTang QilongTang merged commit e223c97 into DynamoDS:master May 23, 2024
24 checks passed
@QilongTang
Copy link
Contributor

@Enzo707 Does not feel rebase would be the best option here, next time maybe just merge the changes on master to your fork?

@QilongTang QilongTang mentioned this pull request May 23, 2024
9 tasks
@Enzo707
Copy link
Contributor Author

Enzo707 commented May 23, 2024

@Enzo707 Does not feel rebase would be the best option here, next time maybe just merge the changes on master to your fork?

@QilongTang Got it!

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.

None yet

9 participants