Repository navigation
Conversation
The licensed/Trial IgniteUI.Blazor package is moving onto this package for its small components and builds its charts, grids and Dock Manager on the same base classes. An IL scan of its components against 0.4.0 found what it cannot reach; this change provides it: - InternalsVisibleTo the Infragistics-signed IgniteUI.Blazor assembly (keyed to eng/IG.publickey.hex, unconditional so release builds keep it). - BaseCollection<T>, JsonSerializable, SerializationContext, SerializationFilter and IDataIntentAttribute are public again but [EditorBrowsable(Never)]: public full-package types derive from them, which friend access cannot allow (CS0060). DataIntentAttribute is public. - SetPropertyValue is internal instead of private (used by the grids). - RendererSerializer exposes its Context and ShouldWrite internally so the full package can serialize its drawing types as extension methods. - Content-child host hook: components implementing the internal IContentChildHost cascade themselves to their child content, and IgbFormatSpecifier attaches to / detaches from the nearest host. Lets an IgbNumberFormatSpecifier declared inside a chart axis keep working. Non-host components render exactly as before. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The components called igSendMessage, igCheckReady, igWaitForLoaded, igRequestLoad, igSetResourceString and igUnmarshalledDataSource* as functions on window. Two Ignite UI packages on one page (Lite plus the full IgniteUI.Blazor) would overwrite each other's, so the interop now follows Blazor JS isolation: - index.ts exports the functions instead of assigning them to window; a new fixed-name entry, interop.js, re-exports them, so importing it reuses the instance the initializer loaded. igSendMessages (dead: it called an undefined window.sendMessage), igConvertReturnValue and the raisingEvent flag are gone. - InteropModule imports the module once per runtime and path. Calls made while it is still importing are queued and dispatched in call order, so fire-and-forget messages keep their order; synchronous calls (WASM) use the imported IJSInProcessObjectReference, available once EnsureReady has completed (a precondition of sync invokes already). The runtime service disposes its modules. - Unmarshalled data (WASM) goes to the module on every TFM: a synchronous in-process call with the address of the local holding the columns. The net8-only InvokeUnmarshalled fast path needed a window global and is dropped; the client now dereferences the address with whichever heap reader the runtime has (getValue on net8, Blazor.runtime on net9+). - Tests: the bUnit harness records the module interop; the unmarshalled channel records through an IUnmarshalledColumnSink module double. static-web-assets tests pin interop.js's exports and assert no interop function is put on window. Verified: unit suite (net8/9/10, only the pre-existing locale-dependent RatingTests.Methods_FollowContract failure), JS tests, and the Playwright integration suite (89/89, Server + WASM). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Builds on the interop module: a component asks for its module through the overridable (private protected) InteropModulePath, so the full IgniteUI.Blazor package's components can talk to their own client runtime while this package's components keep using interop.js. Nothing in either runtime is shared through window. - BaseRendererControl.InteropModulePath (defaults to Lite's interop.js) selects the module for messages, readiness, resource strings and the unmarshalled data channel (RuntimeHelper resolves it lazily). - The runtime tracks client module load requests per interop module, so the same module name requested by two packages loads in both; internal ModuleLoader overloads take the interop module path. - Tests: a component overriding the path sends only to its module, and load requests are routed and tracked per module. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The JS initializer is the whole bootstrap: a flat list of static imports that Blazor awaits before it starts. It now includes interop.js next to the app entry and api.js, so the module the components import through JS isolation is already evaluated when the first component asks for it - its import() resolves to that instance without another fetch, and no startup step depends on window state (the former document.write / window-guard bootstrap of the full package is not needed on this path). static-web-assets tests assert the initializer covers interop.js. Verified with the Playwright integration suite (89/89). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
docs/PACKAGE-CONTRACT.md lists what the full package relies on: friend access pinned to the Infragistics key, the public-hidden base types, the content-child host, the per-package interop module, the fixed asset names under _content/IgniteUI.Blazor (interop.js exports, api.js, lit-html.js, themes) and the absence of window interop state. api.js's getRegisteredScript stays @internal (out of api.d.ts) but is now documented as a stable cross-package export: the full package's runtime resolves *Script parameters through it, so one registry serves both. static-web-assets tests pin the fixed file names and that export. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Found by compiling the full IgniteUI.Blazor package against this package: - MarshalByValueFactory.AddProvider: the full package registers its own by-value types (chart/grid value objects), consulted after this package's. - BaseRendererControl.FindByName is internal virtual, like the element's, so generated types override both the same way. - The shared client custom elements (igc-portal-*, igc-template-container, igc-template-content, and those registered through RegisterElementHelper) are defined only when not defined yet: with both packages' client runtimes on a page, the second definition threw and stopped that runtime from loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Documents, for the next person touching this, why Name intentionally has no [Parameter] (per #436) and where the full package gets a Name markup attribute instead: its generator shadows Name with 'new' + [Parameter] on its own root, non-MarshalByValue BaseRendererElement-derived types (chart axes, series, gauges), rather than this package reintroducing [Parameter] on the shared base - which would retrigger analyzer BL0005 on this package's own MarshalByValue types (e.g. IgbIconMeta) that still use plain object-initializer syntax in tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…into dkamburov/full-package-extensibility
… in IgniteUI.Blazor package
…eUI.Blazor package
…into dkamburov/full-package-extensibility
| index: number, | ||
| columns: any, | ||
| ) { | ||
| columns = derefColumns(columns); |
Comment on lines
+122
to
+125
| catch (Exception) | ||
| { | ||
| // Fire-and-forget calls: one failing must not keep the rest from being dispatched. | ||
| } |
Comment on lines
+149
to
+151
| catch (JSDisconnectedException) | ||
| { | ||
| } |
Comment on lines
+152
to
+154
| catch (JSException) | ||
| { | ||
| } |
Comment on lines
+155
to
+157
| catch (OperationCanceledException) | ||
| { | ||
| } |
Comment on lines
+158
to
+160
| catch (ObjectDisposedException) | ||
| { | ||
| } |
This branch has not been deployed
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.
Description
Moves the client interop off
windowinto an ES module (interop.js), using Blazor JS isolation.The components used to call
igSendMessage,igCheckReady,igWaitForLoaded,igRequestLoad,igSetResourceStringandigUnmarshalledDataSource*as functions onwindow. They now import_content/IgniteUI.Blazor/interop.jsthroughIJSRuntimeinstead.Client (TypeScript)
index.tsexports the interop functions instead of assigning them towindow.interop.ts, is emitted asinterop.jsand re-exports them. Importing it reuses the instance the initializer already loaded.IgniteUI.Blazor.Lite.lib.module.js) now preloadsinterop.jsnext to the app entry andapi.js. The first component'simport()then resolves without another fetch (Audit and update the IgniteUI.Blazor bootstrap script for current hook support #256).igSendMessages(dead code that called an undefinedwindow.sendMessage),igConvertReturnValueand theraisingEventflag.*Scriptlate-registration replay inindex.tsnow callssendMessagedirectly instead ofwindow.igSendMessage..NET
InteropModuleimports the module once per runtime and path. Calls made while it is still importing are queued and dispatched in call order, so fire-and-forget messages keep their order. Synchronous calls (WASM) use the importedIJSInProcessObjectReferenceonceEnsureReadyhas completed. The runtime service disposes its modules.InvokeUnmarshalledfast path needed a window global and is dropped. The client reads the address with whichever heap reader the runtime has:getValueon net8,Blazor.runtimeon net9+.Tests
IUnmarshalledColumnSinkmodule double.static-web-assetstests pin the exports ofinterop.js, assert the initializer covers it, and assert that no interop function is put onwindow.static-web-assets.test.mjs, which had a missing});and could not be parsed.Motivation / Context
Library globals on
windowcollide when two Ignite UI packages are on one page, because each one overwrites the other's. Isolating the interop in a module removes that.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionalityCloses #255