Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
scheduler
Advanced tools
The scheduler package is a lightweight coordination module that allows for scheduling work with different priorities. It is used by React internally for its own scheduling of updates, and it can be used in other contexts to manage tasks with various levels of urgency.
Immediate Priority Scheduling
Schedules a task to be performed with the highest priority, effectively running it as soon as possible.
import { unstable_scheduleCallback, unstable_ImmediatePriority } from 'scheduler';
unstable_scheduleCallback(unstable_ImmediatePriority, () => {
console.log('Run this task immediately');
});
User Blocking Priority Scheduling
Schedules a task with a priority level that is high but not as immediate, suitable for tasks that must respond to user input, like input handlers.
import { unstable_scheduleCallback, unstable_UserBlockingPriority } from 'scheduler';
unstable_scheduleCallback(unstable_UserBlockingPriority, () => {
console.log('Run this task with user-blocking priority');
});
Normal Priority Scheduling
Schedules a task with a normal priority, which is suitable for tasks that do not need to be run immediately or in response to direct user input.
import { unstable_scheduleCallback, unstable_NormalPriority } from 'scheduler';
unstable_scheduleCallback(unstable_NormalPriority, () => {
console.log('Run this task with normal priority');
});
Idle Priority Scheduling
Schedules a task with the lowest priority, which will run when the browser is idle, suitable for background and low priority tasks.
import { unstable_scheduleCallback, unstable_IdlePriority } from 'scheduler';
unstable_scheduleCallback(unstable_IdlePriority, () => {
console.log('Run this task when the browser is idle');
});
A cron-like and not-cron-like job scheduler for Node.js. It allows scheduling using cron syntax as well as more flexible date-based scheduling, unlike the scheduler package which is more about prioritizing task execution.
A light and flexible job scheduling library for Node.js that uses MongoDB for persisting job data. It's more feature-rich for job scheduling with persistence, compared to the in-memory scheduling approach of the scheduler package.
A Redis-based queue system for handling distributed jobs and messages in Node.js. It's more suitable for distributed systems and offers features like rate limiting, which are not present in the scheduler package.
A library for describing recurring schedules and calculating their occurrences. It provides a more human-readable way of scheduling tasks, unlike the scheduler package which focuses on task prioritization rather than recurrence patterns.
scheduler
This is a package for cooperative scheduling in a browser environment. It is currently used internally by React, but we plan to make it more generic.
The public API for this package is not yet finalized.
The React team thanks Anton Podviaznikov for donating the scheduler
package name.
0.14.0 (October 7, 2015)
react
package into two: react
and react-dom
. This paves the way to writing components that can be shared between the web version of React and React Native. This means you will need to include both files and some functions have been moved from React
to ReactDOM
.react-addons-clone-with-props
, react-addons-create-fragment
, react-addons-css-transition-group
, react-addons-linked-state-mixin
, react-addons-perf
, react-addons-pure-render-mixin
, react-addons-shallow-compare
, react-addons-test-utils
, react-addons-transition-group
, react-addons-update
, ReactDOM.unstable_batchedUpdates
).props
) which returns a JSX element, and this function may be used as a component.getDOMNode()
to get the underlying DOM node. Starting with this release, a ref to a DOM component is the actual DOM node. Note that refs to custom (user-defined) components work exactly as before; only the built-in DOM components are affected by this change.React.initializeTouchEvents
is no longer necessary and has been removed completely. Touch events now work automatically.TestUtils.findAllInRenderedTree
and related helpers are no longer able to take a DOM component, only a custom component.props
object is now frozen, so mutating props after creating a component element is no longer supported. In most cases, React.cloneElement
should be used instead. This change makes your components easier to reason about and enables the compiler optimizations mentioned above.createFragment
helper to migrate, which now returns an array.classSet
has been removed. Use classnames instead.class
instead of className
.this.getDOMNode()
is now deprecated and ReactDOM.findDOMNode(this)
can be used instead. Note that in the common case, findDOMNode
is now unnecessary since a ref to the DOM component is now the actual DOM node.setProps
and replaceProps
are now deprecated. Instead, call ReactDOM.render again at the top level with the new props.React.Component
in order to enable stateless function components. The ES3 module pattern will continue to work.style
object between renders has been deprecated. This mirrors our change to freeze the props
object.cloneWithProps
is now deprecated. Use React.cloneElement
instead (unlike cloneWithProps
, cloneElement
does not merge className
or style
automatically; you can merge them manually if needed).CSSTransitionGroup
will no longer listen to transition events. Instead, you should specify transition durations manually using props such as transitionEnterTimeout={500}
.React.Children.toArray
which takes a nested children object and returns a flat array with keys assigned to each child. This helper makes it easier to manipulate collections of children in your render
methods, especially if you want to reorder or slice this.props.children
before passing it down. In addition, React.Children.map
now returns plain arrays too.console.error
instead of console.warn
for warnings so that browsers show a full stack trace in the console. (Our warnings appear when you use patterns that will break in future releases and for code that is likely to behave unexpectedly, so we do consider our warnings to be “must-fix” errors.)Symbol
in browsers that support it, in order to ensure that React never considers untrusted JSON to be a valid element. If this extra security protection is important to you, you should add a Symbol
polyfill for older browsers, such as the one included by Babel’s polyfill.capture
, challenge
, inputMode
, is
, keyParams
, keyType
, minLength
, summary
, wrap
. It also now supports these non-standard attributes: autoSave
, results
, security
.xlinkActuate
, xlinkArcrole
, xlinkHref
, xlinkRole
, xlinkShow
, xlinkTitle
, xlinkType
, xmlBase
, xmlLang
, xmlSpace
.image
SVG tag is now supported by React DOM.is="..."
attribute).audio
and video
tags: onAbort
, onCanPlay
, onCanPlayThrough
, onDurationChange
, onEmptied
, onEncrypted
, onEnded
, onError
, onLoadedData
, onLoadedMetadata
, onLoadStart
, onPause
, onPlay
, onPlaying
, onProgress
, onRateChange
, onSeeked
, onSeeking
, onStalled
, onSuspend
, onTimeUpdate
, onVolumeChange
, onWaiting
.shallowCompare
add-on has been added as a migration path for PureRenderMixin
in ES6 classes.CSSTransitionGroup
can now use custom class names instead of appending -enter-active
or similar to the transition name.document.body
directly as the container to ReactDOM.render
now gives a warning as doing so can cause problems with browser extensions that modify the DOM.<option>
elements with multiple text children properly and renders <select>
elements on the server with the correct option selected.React.createElement('DIV')
) no longer causes problems, though we continue to recommend lowercase for consistency with the JSX tag name convention (lowercase names refer to built-in components, capitalized names refer to custom components).animationIterationCount
, boxOrdinalGroup
, flexOrder
, tabSize
, stopOpacity
.Simulate.mouseEnter
and Simulate.mouseLeave
now work.react-tools
package and JSXTransformer.js
browser file have been deprecated. You can continue using version 0.13.3
of both, but we no longer support them and recommend migrating to Babel, which has built-in support for React and JSX.optimisation.react.inlineElements
transform converts JSX elements to object literals like {type: 'div', props: ...}
instead of calls to React.createElement
. This should only be enabled in production, since it disables some development warnings/checks.optimisation.react.constantElements
transform hoists element creation to the top level for subtrees that are fully static, which reduces calls to React.createElement
and the resulting allocations. More importantly, it tells React that the subtree hasn’t changed so React can completely skip it when reconciling. This should only be enabled in production, since it disables some development warnings/checks.FAQs
Cooperative scheduler for the browser environment.
The npm package scheduler receives a total of 22,334,679 weekly downloads. As such, scheduler popularity was classified as popular.
We found that scheduler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.