Skip to content

Releases: discoveryjs/discovery

1.0.0-beta.91

25 Nov 02:59
Compare
Choose a tag to compare
  • Changes related to Model#context:
    • Added context to Model options, allowing the model's context to be set and accessible from the beginning (available during setup and in extensions)
    • Added Model#setContext(context, replace) method, which extends the current context with the provided value or replaces it if replace is true
    • Added context event to Model, with prevContext and nextContext parameters, triggered when the context changes
    • Changed Model#context to be an accessor property, where the setter calls Model#setContext(value, true)
    • Changed ViewModel#setData() to no longer accept a context argument or change the context
    • Changed ViewModel#setDataProgress() to no longer change the context, despite accepting context argument
    • Updated ViewModel to trigger a render when the context event is fired
  • Added Model#legacyPrepare readonly property to indicate whether the legacy prepare method is used or the new setup() method
  • Updated struct view to define the setStructViewAnnotations action when using the new setup() method, allowing custom annotations to be specified across all struct views
  • Updated embed option of App to accept a config
  • Added EmbedApp#publicApi.notify(name, details) method for sending notifications
  • Introduced onNotify(name, details) option in the embed extension to define a callback for handling notification messages from the embed host
  • Added EmbedApp#publicApi.setLocationSync() method to simplify sync between the embed app and the host location, preventing potential pitfalls
  • Added ViewModel#enforceScheduledRenders() to immediately execute scheduled renders
  • Changed ViewModel#scheduleRender() to use setTimeout() instead of Promise.resolve() to ensure proper processing of event loop tasks, eliminating unnecessary renders
  • Changed ViewModel initialization to minimize unnecessary renders
  • Marked ViewModel#renderPage(), ViewModel#renderSidebar(), and ViewModel#renderPage() as private methods, as they are not intended for direct invocation anymore
  • Fixed ViewModel#setPageParams() to normalize the hash by ensuring it starts with #, preventing unnecessary events; for example, passing #page and page into the method will now consistently result in #page being stored in ViewModel#pageHash
  • Redesigned logging API, the changes allow to see the correct loaction of logging method call instead of a location inside of the Model#log() method:
    • Added Logger class to utils
    • Changed Model#logger to hold a Logger instance
    • Removed Model#logLevel, use Model#logger.logLevel for getting or setting the log level
    • Deprecated Model#log() method, which do nothing but display an error:
      • Use Model#logger[level](...args) instead of Model#log('level', ...args)
      • Use Model#logger[level].group(message, fn | array) or Model#logger[level].groupCollapsed(message, fn | array) instead of Model#logger({ level, message, collapsed: fn | array })

1.0.0-beta.90

15 Nov 04:43
Compare
Choose a tag to compare
  • Added @discoveryjs/discovery/embed export
  • Changed applyContainerStyles() to take a single darkmode value instead of "options", with supported values: true, false, 'true', 'false', 'dark', 'light' and 'auto'
  • Changed applyContainerStyles() to avoid applying transition styles to the container, preventing unwanted flashes of opposite colors
  • Changed source view to take source, syntax, lineNum, refs and maxSourceSizeToHighlight options. It attempts to derive these values from data when options are not explicitly provided for backward compatibility. The source can be derived from data as content (for backward compatibility) or source property
  • Removed mime, binary and size data options for source view
  • Bumped marked to ^14.1.4 (used in markdown view)
  • Added styles for <kbd> in markdown view
  • Improved string rendering in the values popup of signature view
  • Fixed optional values statistics in signature view
  • Fixed navigation history update on the query graph changes on discovery page
  • Fixed scrollbar color schema in darkmode mode

1.0.0-beta.89

04 Nov 17:49
Compare
Choose a tag to compare
  • Renamed Widget class into ViewModel
  • Added pageStateChange event to ViewModel, triggered when pageId, pageRef, or pageParams changes
  • Added query property to functions produced from a string (jora query), i.e. with Model#queryFn(query)
  • Added clipboard option to the upload extension for enabling loading data from the clipboard
  • Added support for uploading files from paste event
  • Added unloadData nav button
  • Renamed loadData nav button into uploadFile
  • Changed Model#unloadData() method to not reset context
  • Added app-header view
  • Model's info:
    • Added name, version, description, and icon options for Model, storing these values in the info property
    • Added model property to a render context (result of ViewModel#getRenderContext()) reflecting info value
    • Added --discovery-app-icon CSS custom property which contains value of model's icon
  • Added @discoveryjs/discovery/utils export
  • Changed the extension application order for App so that options.extensions are applied after implicit extensions
  • Changed nav-button view to align with button view (text, href and external as config options, disabled is no longer treated as query)
  • Modified PageRenderer#define() and ViewRenderer#define() to allow specifying all options with a single config parameter:
    // new signature
    discovery.page.define('example', { render: [/* ... */], ...restOptions });
    // old signature remains compatible
    discovery.page.define('example', [/* ... */], { /* options */ });
  • Removed export default in the core modules
  • Fixed Model#pathToQuery() method to correctly generate a query when part of the path contains a jora keyword
  • Fixed an edge case in the table view when rendering a single cell with an explicit column setup and row data containing non-object values

1.0.0-beta.88

24 Oct 21:40
Compare
Choose a tag to compare
  • Added context option for all views, which executes before data and replaces the input context value with its result
  • Added rows option for table view to specify data for rows, with data being used by default if rows is not specified
  • Added detailsWhen option for table cells to explicitly control the activation of details
  • Changed button view to take text, href and external options; it attempts to derive these values from data when options are not explicitly provided for backward compatibility
  • Changed button view so that disabled values are no longer treated as queries. To use a query for disabling a button, specify it explicitly like { view: "button", disabled: "=query" }
  • Improved the computation of estimated JSON size in the struct view actions popup, making it 2x faster
  • Fixed behavior of tooltip option to display a tooltip with a delay by default
  • Fixed TypeScript warning related to switch view export due switch is reserved word and can't be an identifier

1.0.0-beta.87

16 Oct 03:06
Compare
Choose a tag to compare
  • Enhanced style of errors on the loading data overlay
  • Enhanced responsiveness and addressing issues with freezing during transition states for views related to the data loading state. Instead of setup of initial state via JavaScript, the new @starting-style at-rule is used:
    • Tweaked styles to improve the performance perception
    • Widget:
      • Removed adding of .init class to the main container in initDom()
    • App:
      • Removed adding of .init class to the overlay during the initialization phase
    • Progressbar:
      • Added adding .done and .error classes on the main container on progressbar finish
      • Removed delay option from the constructor
      • Removed appearanceDelay property
      • Removed adding .init class to the main container at the first stage change
  • Changed createLoadDataState() to take a dataset factory function instead of a load data request, enhancing its reusability
  • Fixed re-rendering on data unload
  • Fixed Model#decodePageHash() to return null for pageRef instead of undefined
  • Fixed Widget#setPageHash() to always emit hashChanged when hash changes, disregarding changes of pageId, pageRef and pageParams
  • Fixed preloader styles to ensure the data loading progressbar remains visible during the prepare stage
  • Fixed value counting in the signature view when a property contains duplicated objects, which previously led to incorrect optional label
  • Fixed warning "Added non-passive event listener..." in Chrome caused by CodeMirror (codemirror/codemirror5#6735)
  • Fixed missed error on progressbar's value when the progressbar finishes with error

1.0.0-beta.86

28 Sep 02:21
Compare
Choose a tag to compare
  • Added setWorkTitle method to the prepare context API to display additional text on the progress bar:
    export function async prepare(input, { setWorkTitle }) {
        await setWorkTitle('phase 1');
        // ...
        await setWorkTitle('phase 2');
        // ...
    }
    When used, it could look like the following:
Screen.Recording.2024-09-28.at.04.16.48.mov
  • Refactor Progressbar:
    • Added setStateStep(step) method to set a secondary text for the stage
    • Changed setState() method to take second optional parameter step
    • Modified logic for await repainting
    • Added awaitRepaintPenaltyTime property to indicate time spending on awaiting for repaint
    • Changed onFinish callback to add awaitRepaintPenaltyTime to timings array
    • Added decoding stage
    • Renamed receive stage into receiving
    • Removed lastStage as it redundant, use value.stage instead
  • Changes in data loading:
    • Added decoding stage for load state
    • Renamed receive stage into receiving for load state
    • Added loadingTime and decodingTime into dataset timings
  • Fixed crashing the entire render tree on an exception in a view's render function; now, crashes are isolated to the affected view
  • Fixed unnecessary view rendering when returning to the discovery page
  • Fixed hiding a popup with hideOnResize: true when scrolling outside of the popup element
  • Fixed load data timings section title in console
  • Added TypeScript typings for Popup

1.0.0-beta.85

15 Sep 20:23
Compare
Choose a tag to compare
  • Changed Widget#scheduleRender() to schedule render for all subjects when no subject is specified (invoked without parameters)
  • Bumped jora to 1.0.0-beta.13
  • Added display of tens marks in struct view
  • Added new actions for expanded values in the struct view:

    These actions activate when certain actions are available in the context. First, if the queryAcceptChanges action exists and returns a truthy value for the struct's data (root value), then specific actions like querySubquery and queryAppend are checked for existence. If they exist, the relevant actions are added to the actions menu. These actions should take a path and struct view data and make relevant changes to the query that the current struct view instance is based on. The discovery page provides such actions in the context, so any struct view that takes query editor output as its input data provides these actions.

    • "Create a subquery from the path" – calls the querySubquery action from the context (i.e., #.action.querySubquery), which creates on the discovery page a new node in the query graph with the selected path.
    • "Append path to current query" – calls the queryAppend action, which appends on the discovery page the selected path to the current query in the query editor.
  • Changes for table view:
    • Changed rendering of arrays when it's a row value, to render as other non-object values using struct view
    • Renamed scalarCol option into valueCol
    • Tweaked styles to dim the display of true, false, null, NaN, and Infinity values to differentiate them from strings and numbers
    • Changed in the cols configuration:
      • Added the colWhen option (like when or whenData) for the table view to conditionally render columns based on the table's data
      • Added the contentWhen option (like when or whenData) for table-cell to conditionally render cell content based on the cell's data
      • Changed the when and whenData options to behave as regular options for the table-cell view:
        • Previously, when canceled column rendering; now colWhen should be used instead
        • Previously, whenData canceled cell content rendering; now contentWhen (the table-cell option) should be used instead

1.0.0-beta.84

05 Sep 14:47
Compare
Choose a tag to compare
  • Added TypeScript typings for core functionality
  • Introduced the Model class as a base for Widget and App:
    • Added a new setup option for configuring model-related aspects during initialization (immutable during the lifecycle), such as object markers, additional query methods, etc.
    • Implements loadDataFrom* methods, so all the classes able to load data now
  • Added handling of empty payload on data loading (raise an error "Empty payload")
  • Added props options for a view definition, a function (or a string as a jora query) (data, { props, context}) => any which should return a normalized props
  • Added additional block into inspector popup to display normalized props when view.options.props is specified
  • Added overrideProps(obj) jora helper method which overrides object's values (current) with values from passed obj (#.props by default)
  • Changed getReadableStreamFromSource() util function to use a Blob to produce a ReadableStream from a value
  • Changed loadDataFrom*() functions to return { state, dataset } object instead of { state, result } (renamed result into dataset)
  • Modified the link, text, text-numeric and text-match views to allow all render props to be passed via config, in addition to data
  • Tweaked the source view to display tabs as 4 spaces (tab-size: 4)
  • Added onClick option for badge views
  • Removed hint option for badge views, use tooltip option instead
  • Removed fallback methods for obtaining a ReadableStream from a Blob
  • Fixed resolving a value for main content for badge views
  • Fixed crashing the entire render tree on an exception in a data query; now, crashes are isolated to the affected view
  • Fixed discovery page main content styling
  • Bumped jora to 1.0.0-beta.12

1.0.0-beta.83 Introducing encodings

04 Apr 02:33
Compare
Choose a tag to compare
  • Added encodings option for App, Widget (has no effect for now), preloader (via loadDataOptions) and Loading Data API (see Encodings)

1.0.0-beta.82

24 Mar 00:19
Compare
Choose a tag to compare
  • Rebranded the "report page" as the "discovery page"
    • Changed text on button Make reportDiscover
    • Changed page slug reportdiscovery
    • Added redirect for locations #report...#discovery..., use Widget.options.intoreportToDiscoveryRedirect to disable it
    • Widget#reportPageIdWidget#discoveryPageId, with default discovery instead of report
    • Widget.options.reportPageIdWidget.options.discoveryPageId
    • navButtons.reportPagenavButtons.discoveryPage, button's name changed into discovery-page
    • CSS classes:
      • .report-*.discovery-*
      • .discovery-editor.discovery-view-editor
  • Added positionMode option for popup view. When set to "natural", the popup attempts to position itself at the bottom right side if dimensions allow, instead of positioning towards the larger available space by default (value "safe" for the option)
  • Added pointerOffsetX and pointerOffsetY options for popup view and view.tooltip
  • Enabled positionMode: natural for tooltips by default, can be changed via tooltip options
  • Exposed type checking helpers isArray(), isSet() and isRegExp()
  • Fixed badge view options when it receives an array as data
  • Fixed struct view annotation styling to avoid treating href values as links when they are falsy
  • Fixed a sticky tooltip for "Enable view inspection" button on inspecting start
  • Fixed the delayed popup display after calling the hide() method
  • Fixed positioning of popups with position: pointer
  • Fixed animation of the inspector's details popup when transitioning into full-screen mode